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

前端 未结 5 742
后悔当初
后悔当初 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条回答
  •  野的像风
    2021-02-07 04:56

    The simplest solution is:

    bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic nil_RF2_P2 --from-beginning --consumer-property group.id=test1

    In case you specify the flag --from-beginning just remember that the consumer group should not have consumed any records in the past or else your consumer will start consuming from the earliest not consumed record by the specified group (and not from the actual beginning, as you may incorrectly assume).

提交回复
热议问题