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?
I haven't tried this myself, but it seems to make sense.
You can also use kafka.tools.ConsumerOffsetChecker (source).
kafka.tools.ConsumerOffsetChecker