Reading messages from start - new job submission

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading messages from start - new job submission

avilevi
I'm updating a job without savepoint.
The consumer properties is set to   prop.setProperty("auto.offset.reset", "earliest")
The start strategy is not explicitly set (using the default setStartFromGroupOffsets).
In this case I expect that the consumer will read the messages from the beginning since there is no offset restored, but is actually reading from latest. What am I missing? 

Best
Avi

Reply | Threaded
Open this post in threaded view
|

Re: Reading messages from start - new job submission

sohimankotia
Reply | Threaded
Open this post in threaded view
|

Re: Reading messages from start - new job submission

avilevi
Reply | Threaded
Open this post in threaded view
|

Re: Reading messages from start - new job submission

avilevi
In reply to this post by sohimankotia
Thanks for the answer,
But my question is why do  I need to set
/myConsumer.setStartFromEarliest();/  if I set this property
/setProperty("auto.offset.reset", "earliest") /in consumer properties ?
I want the consumer to start reading from earliest only If offsets could not
be found as stated in the documentation.
isn't that the expected behaviour ?

Best wishes
Avi



--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Reading messages from start - new job submission

Dian Fu
Hi Avi,

As described in the documentation: "If offsets could not be found for a partition, the auto.offset.reset setting in the properties will be used.". For starting from GroupOffset, the property "auto.offset.reset" will ONLY be respected when the group offset cannot be found for a partition. Otherwise, it will use the offset found.

Regards,
Dian

> 在 2019年2月20日,上午1:49,avilevi <[hidden email]> 写道:
>
> Thanks for the answer,
> But my question is why do  I need to set
> /myConsumer.setStartFromEarliest();/  if I set this property
> /setProperty("auto.offset.reset", "earliest") /in consumer properties ?
> I want the consumer to start reading from earliest only If offsets could not
> be found as stated in the documentation.
> isn't that the expected behaviour ?
>
> Best wishes
> Avi
>
>
>
> --
> Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/