Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the --group option deprecated from kafka-console-consumer tool? if so, how can I set the consumer group using kafka-console-consumer.

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).

like image 623
Nirmal Manoharan Avatar asked Dec 09 '15 20:12

Nirmal Manoharan


People also ask

Is consumer group optional in Kafka?

Consumer group.id is mandatory. If you do not set consumer group.id , you will get exception. So obviously you're setting it somewhere in your code or the framework or library you're using is setting it internally. You should always set group.id by yourself.

How do I get consumer group in Kafka?

Step1: Open the Windows command prompt. Step2: Use the '-group' command as: 'kafka-console-consumer -bootstrap-server localhost:9092 -topic -group <group_name>' . Give some name to the group. Press enter.

How do I change consumer group in Kafka?

How to change consumer offset? Use the kafka-consumer-groups.sh to change or reset the offset. You would have to specify the topic, consumer group and use the –reset-offsets flag to change the offset.

Is group ID mandatory for Kafka consumer?

The consumer group-id is mandatory, it plays a major role when it comes to scalable message consumption. To start a consumer group-id is mandatory.


1 Answers

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.

like image 193
Nirmal Manoharan Avatar answered Jan 04 '23 11:01

Nirmal Manoharan