You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Hrishikesh Mishra <sd...@gmail.com> on 2019/10/03 19:29:38 UTC

How auto.offset.reset = latest works

Hi,

I want to understand how does *auto.offset.reset = latest *work. When
consumer first call poll() method, will it assign the current offsets to
consumer for all partition (when single consumer is up in a consumer
group)? How do I know all partitions are assigned to a consumer?


Regards
Hrishikesh

Re: How auto.offset.reset = latest works

Posted by "M. Manna" <ma...@gmail.com>.
If I get your question right, your concern isn't about auto.offset.reset -
it's the partition assignment.

consumer group represents parallelism. It's well-documented in Kafka
official docs. Each consumer (in a consumer group) gets fare share of job
(i.e. # partitions for a topic subscription). Due to rebalance or
disgraceful departure of consumers from a group, the partitions get
reassigned to live consumers. In that case you will end up having some
difference in workload per consumer in a group. Once again, this is
well-explained in the official doc.

Thanks,

On Thu, 3 Oct 2019 at 20:30, Hrishikesh Mishra <sd...@gmail.com> wrote:

> Hi,
>
> I want to understand how does *auto.offset.reset = latest *work. When
> consumer first call poll() method, will it assign the current offsets to
> consumer for all partition (when single consumer is up in a consumer
> group)? How do I know all partitions are assigned to a consumer?
>
>
> Regards
> Hrishikesh
>

Re: How auto.offset.reset = latest works

Posted by "Matthias J. Sax" <ma...@confluent.io>.
You can get the assigned partitions via `Consumer#assignment()`.

And yes, if `auto.offset.reset` triggers and it set to "latest" the
consumer will get the end-offset for each assigned partition and start
reading from there.


-Matthias

On 10/3/19 12:29 PM, Hrishikesh Mishra wrote:
> Hi,
> 
> I want to understand how does *auto.offset.reset = latest *work. When
> consumer first call poll() method, will it assign the current offsets to
> consumer for all partition (when single consumer is up in a consumer
> group)? How do I know all partitions are assigned to a consumer?
> 
> 
> Regards
> Hrishikesh
>