how to set group name when consuming messages in kafka using command line

前端 未结 5 802
后悔当初
后悔当初 2021-02-07 04:53

Any idea how to set group name when consuming messages in kafka using command line.

I tried with the following command :

bin/kafka-console-consumer.sh --         


        
5条回答
  •  萌比男神i
    2021-02-07 05:04

    if you want change group id without lost offset of record you have get offset manually of current Group.id and set to new run consumer that have new id. if don't have any control to get offset in consumer instance you can run this command.

    /bin/kafka-consumer-groups.sh --new-consumer --bootstrap-server :  --group Group_name --describe
    

    and then you can seek data from specific offset. pay attention you should call seek after call poll، Assign command not work. also you can see my sample of code in github

    Example here

提交回复
热议问题