Auto.offset.reset
Values of three parameters, namely earliest
, latest
,none
earliest:
When offset has been submitted under the district, from start spending offset submitted; no offset submitted from scratch consumption
latest:
Under no offset data when submitted, a new consumer created the partition; when there is offset submitted under the district, from start spending offset submitted
none:
topic when the partitions are present offset submitted, after the offset from the beginning of the consumer; as long as there is a partition offset submitted does not exist, an exception is thrown
The default is recommended earliest
, after kafka error after setting the parameters restart, find unconsumed offset can continue to consume
while latest
this setting is easy to lose the message, if the problem, as well as data kafka topic appears to write, this time to restart kafka, this setting from the latest offset start spending, the problem is that the data center is lost
none
in this setting poor compatibility, error-prone