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
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