kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Imran Rashid <im...@therashids.com>
Subject Re: Is there a way to get the offset of a consumer of a topic?
Date Wed, 04 Dec 2013 20:49:14 GMT
You can use ConsumerOffsetChecker
https://github.com/apache/kafka/blob/0.8/core/src/main/scala/kafka/tools/ConsumerOffsetChecker.scala
(thats a link to the 0.8 code, but its also in 0.7)

it just prints current offsets to screen, but you can look at the code
to see what you'd do to just the offsets and do whatever else you
want.

I actually wanted to write the monitoring tool whenever I get a
chance, so I'd love to see it done :)

imran

On Wed, Dec 4, 2013 at 12:40 PM, S L <slouie.at.work@gmail.com> wrote:
> Hi,
> I was wondering if there's an easy way to get the current offset of a
> specified consumer?  What we need is something to check the consumer offset
> every 5 min.  If it's changing at a certain rate every time we check, good.
>  If not, then we have a problem.  I was going to write a monitoring program
> to check the broker or consumer for this offset to see if it changed and
> how much it changed since the last time I checked it.
>
> I ran into this pg on the wiki which looks like it's what I need.
> https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-OffsetCommit%2FFetchAPI
>
> However, it says the API calls are not functional yet.  Are there some
> other methods or APIs or JMX bean/object/etc that we can use in the
> meantime?  If I were to ping zookeeper, where do I look for this offset?
>  Thanks in advance for your help.

Mime
View raw message