22#include < iostream>
33#include < csignal>
44#include < boost/program_options.hpp>
5- #include " cppkafka/consumer .h"
5+ #include " cppkafka/producer .h"
66#include " cppkafka/configuration.h"
77#include " cppkafka/metadata.h"
88#include " cppkafka/topic.h"
@@ -12,7 +12,7 @@ using std::exception;
1212using std::cout;
1313using std::endl;
1414
15- using cppkafka::Consumer ;
15+ using cppkafka::Producer ;
1616using cppkafka::Exception;
1717using cppkafka::Configuration;
1818using cppkafka::Topic;
@@ -33,8 +33,6 @@ int main(int argc, char* argv[]) {
3333 (" help,h" , " produce this help message" )
3434 (" brokers,b" , po::value<string>(&brokers)->required (),
3535 " the kafka broker list" )
36- (" group-id,g" , po::value<string>(&group_id)->required (),
37- " the consumer group id" )
3836 ;
3937
4038 po::variables_map vm;
@@ -56,17 +54,16 @@ int main(int argc, char* argv[]) {
5654 // Construct the configuration
5755 Configuration config = {
5856 { " metadata.broker.list" , brokers },
59- { " group.id" , group_id },
6057 // Disable auto commit
6158 { " enable.auto.commit" , false }
6259 };
6360
6461 try {
65- // Construct a consumer
66- Consumer consumer (config);
62+ // Construct a producer
63+ Producer producer (config);
6764
6865 // Fetch the metadata
69- Metadata metadata = consumer .get_metadata ();
66+ Metadata metadata = producer .get_metadata ();
7067
7168 // Iterate over brokers
7269 cout << " Found the following brokers: " << endl;
0 commit comments