5
votes

I am trying to run multiple consumer for the same topic under different group name using the command line tool - kafka-console-consumer.sh. When I set --group option, it fails with error 'group is not a recognized option'. This was working fine until I upgraded to the latest kafka version (kafka_2.11-0.8.2.2).

4
What version did you upgrade from?Morgan Kenyon

4 Answers

6
votes

I figured a way out. The group option is no longer available for the console-consumer. If you need to specify the group, then you can do so by using the --consumer.config option. It takes the path to the consumer.properties file as input. It worked for me.

5
votes

You can use group.id without config file like this : bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --from-beginning --topic test --consumer-property group.id=1

1
votes

--group is not available for bin/kafka-console-consumer.sh in new API.

By default all consumers uses config/consumer.properties where group.id=test-consumer-group. Create one property file anywhere, and put group.id=<your-group-name>.

And when you run your console-consumer, just add one new parameter as --consumer.config <your-newly-created-property-file>

$KAFKA_HOME/bin/kafka-console-consumer.sh --topic <topic-name> --zookeeper <zk-server>:<zk-port> --consumer.config <new-property-file>

0
votes

The group option works for me in version 2.0.0.