You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Edward Buck <eg...@hotmail.com> on 2012/04/05 23:27:09 UTC

Getting offset from ConsumerIterator

In my consumer, I would like to be able to re-request a message at a specific offset. However, the ConsumerIterator does not appear to expose the message offset when you call next(). In order to get an offset for each message, is it necessary to use a SimpleConsumer (the low-level API), rather than KafkaMessageStream (the high-level API)?Thanks,Ed 		 	   		  

Re: Getting offset from ConsumerIterator

Posted by Jun Rao <ju...@gmail.com>.
Ed,

Yes, currently, you would have to use SimpleConsumer. It's possible to add
the offset support in the ZK consumer in the future. We just haven't found
a proper api yet.

Thanks,

Jun

On Thu, Apr 5, 2012 at 2:27 PM, Edward Buck <eg...@hotmail.com> wrote:

>
> In my consumer, I would like to be able to re-request a message at a
> specific offset. However, the ConsumerIterator does not appear to expose
> the message offset when you call next(). In order to get an offset for each
> message, is it necessary to use a SimpleConsumer (the low-level API),
> rather than KafkaMessageStream (the high-level API)?Thanks,Ed
>