kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Stein <joe.st...@stealth.ly>
Subject Re: Question about ConsoleConsumer
Date Thu, 17 Jul 2014 02:14:59 GMT
auto.offset.reset is only when there is not an already established offset
to consume from or an offset that no longer exists (and is invalid) in the
case of truncated logs or compaction).

You can force this behavior by deleting the znode

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

On Wed, Jul 16, 2014 at 10:08 PM, Shao, Saisai <saisai.shao@intel.com>

> Hi folks,
> A newbie question when investigating ConsoleConsumer's code,
> When we use ConsoleConsumer by setting "-from-beginning", we will set
> property as "auto.offset.reset"="smallest", which means moving the offset
> to the beginning of the data. But in the code, we still need to delete
> Zookeeper's group metadata as:
>     if(options.has(resetBeginningOpt))
>       ZkUtils.maybeDeletePath(options.valueOf(zkConnectOpt), "/consumers/"
> + options.valueOf(groupIdOpt))
> From my understanding, setting "auto.offset.rest"="smallest" is enough to
> seek to the beginning of the data, why we still need to delete Zookeeper
> metadata? Is there any specific reason or some under-the-cover concerns?
> Sorry for the unthoughtful question and really appreciate your answer.
> Thanks
> Jerry

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message