That was exactly what I was looking for.  

Thanks
Arun

-----Original Message-----
From: tao xiao [mailto:xiaotao...@gmail.com] 
Sent: Monday, February 16, 2015 12:20 PM
To: users@kafka.apache.org
Subject: Re: API to get the partition number

You can get the partition number and offset of the message by
MessageAndMetadata.partition() and MessageAndMetadata.offset().

To your scenario you can turn off auto commit auto.commit.enable=false and then 
commit by yourself after finishing message consumption.

On Mon, Feb 16, 2015 at 1:40 PM, Arunkumar Srambikkal (asrambik) < 
asram...@cisco.com> wrote:

> Hi,
>
>
> Is there a way to get the current partition number and current offset, 
> when using the *high level consumer* in 0.8.2?
>
> I went through the previous messages and in the previous version I 
> think there are none.
>
> The reason we want to do this, is that I  plan to have a consumer 
> without the default commit of offsets, to avoid the scenario of 
> consumers going down before updating the accurate offset.
>
> Rgds
> Arun
>



--
Regards,
Tao

Reply via email to