You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Sameer Kumar <sa...@gmail.com> on 2017/11/22 11:19:14 UTC

KafkaConsumer current offsets

Hi All,

I wanted to know if there is any way to get the current offsets of a
consumer group through a java api.

-Sameer.

Re: KafkaConsumer current offsets

Posted by simarpreet kaur <si...@gmail.com>.
Hii Sameer,

You can find the current offset of a consumer using method *position *provided
to Kafka Consumer. This method takes the topic partition in parameter to
know which partition you want offset of.
For example, you can do something like
*consumer.position(<topicPartition assigned to consumer>)*

To find the topic partitions assigned to your consumer, you can do*
consumer.assignment().*
For more information on consumer offsets, you can refer to the blog.
<https://blog.knoldus.com/2017/11/05/case-study-to-understand-kafka-consumer-and-its-offsets/>


On Thu, Nov 23, 2017 at 12:39 PM, Sameer Kumar <sa...@gmail.com>
wrote:

> Guys, any thoughts on below request.(getting current offsets of a consumer
> group) through a java api.
>
>
>
> On Wed, Nov 22, 2017 at 4:49 PM, Sameer Kumar <sa...@gmail.com>
> wrote:
>
> > Hi All,
> >
> > I wanted to know if there is any way to get the current offsets of a
> > consumer group through a java api.
> >
> > -Sameer.
> >
>

Re: KafkaConsumer current offsets

Posted by Sameer Kumar <sa...@gmail.com>.
Guys, any thoughts on below request.(getting current offsets of a consumer
group) through a java api.



On Wed, Nov 22, 2017 at 4:49 PM, Sameer Kumar <sa...@gmail.com>
wrote:

> Hi All,
>
> I wanted to know if there is any way to get the current offsets of a
> consumer group through a java api.
>
> -Sameer.
>