The other method is via command line bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --group *groupName* --zkconnect *zkServer:2181*
Refer : https://cwiki.apache.org/confluence/display/KAFKA/System+Tools#SystemTools-ConsumerOffsetChecker https://apache.googlesource.com/kafka/+/0.8.0-beta1-candidate1/core/src/main/scala/kafka/tools/ConsumerOffsetChecker.scala On Wed, Oct 1, 2014 at 8:28 AM, Gwen Shapira <gshap...@cloudera.com> wrote: > Take a look at ConsumerOffsetChecker. It does just that: print the > offset and lag for each consumer and partition. > > You can either use that class directly, or use it as a guideline for > your implementation > > On Wed, Oct 1, 2014 at 2:10 AM, Shlomi Hazan <shl...@viber.com> wrote: > > Hi, > > How can I programmatically get the number of items in a topic, pending > for > > consumption? > > If no programmatic way is avail, what other method is available? > > Shlomi >