Simple Kafka Consumer not receiving messages

后端 未结 6 2288
萌比男神i
萌比男神i 2021-02-09 15:20

I am a newbie to Kafka and running a simple kafka consumer/producer example as given on KafkaConsumer and KafkaProducer. When I am running consumer from terminal, consumer is re

6条回答
  •  眼角桃花
    2021-02-09 16:03

    Run the consumer before running the producer so that the consumer registers with the group coordinator first.Later when u run the producer the consumer consumes the messages.The first time u run the consumer its registering with the group coordinator.In order to find out till what offset the consumer has consumed the messages use this kafka-consumer-offset-checker.bat --group group-1 --topic testing-1 --zookeeper localhost:2181 This shows the consumer has consumed which offset of the topic last.

提交回复
热议问题