Java, How to get number of messages in a topic in apache kafka

后端 未结 17 1500
不思量自难忘°
不思量自难忘° 2020-11-30 19:11

I am using apache kafka for messaging. I have implemented the producer and consumer in Java. How can we get the number of messages in a topic?

17条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-30 19:30

    I haven't tried this myself, but it seems to make sense.

    You can also use kafka.tools.ConsumerOffsetChecker (source).

提交回复
热议问题