You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Yang <te...@gmail.com> on 2015/02/06 11:48:10 UTC

java API equivalent of --from-beginning?

we are trying to achive the equivalent of
bin/kafka-console-consumer.sh


we tried " props.put("auto.offset.reset", "smallest");

but it still doesn't work.

how can I achieve --from-beginning in java code? thanks

(we are using 8.1.1)

Re: java API equivalent of --from-beginning?

Posted by Yang <te...@gmail.com>.
ah... thanks. I was looking at the latest github code
(commit f1ba4ff87e60a6dc06fb3d16e84fa94f8c4a7d9e )
and it doesn't show that line 181

I'll try it out

On Fri, Feb 6, 2015 at 5:37 AM, Joe Stein <jo...@stealth.ly> wrote:

> You have to delete the znode from zookeeper for your consumer group
>
> https://github.com/apache/kafka/blob/0.8.1/core/src/main/scala/kafka/consumer/ConsoleConsumer.scala#L181
>
> /*******************************************
>  Joe Stein
>  Founder, Principal Consultant
>  Big Data Open Source Security LLC
>  http://www.stealth.ly
>  Twitter: @allthingshadoop <http://www.twitter.com/allthingshadoop>
> ********************************************/
>
> On Fri, Feb 6, 2015 at 5:48 AM, Yang <te...@gmail.com> wrote:
>
> > we are trying to achive the equivalent of
> > bin/kafka-console-consumer.sh
> >
> >
> > we tried " props.put("auto.offset.reset", "smallest");
> >
> > but it still doesn't work.
> >
> > how can I achieve --from-beginning in java code? thanks
> >
> > (we are using 8.1.1)
> >
>

Re: java API equivalent of --from-beginning?

Posted by Joe Stein <jo...@stealth.ly>.
You have to delete the znode from zookeeper for your consumer group
https://github.com/apache/kafka/blob/0.8.1/core/src/main/scala/kafka/consumer/ConsoleConsumer.scala#L181

/*******************************************
 Joe Stein
 Founder, Principal Consultant
 Big Data Open Source Security LLC
 http://www.stealth.ly
 Twitter: @allthingshadoop <http://www.twitter.com/allthingshadoop>
********************************************/

On Fri, Feb 6, 2015 at 5:48 AM, Yang <te...@gmail.com> wrote:

> we are trying to achive the equivalent of
> bin/kafka-console-consumer.sh
>
>
> we tried " props.put("auto.offset.reset", "smallest");
>
> but it still doesn't work.
>
> how can I achieve --from-beginning in java code? thanks
>
> (we are using 8.1.1)
>