Auto.offset.reset

Auto.offset.resetValues 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 latestthis 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
nonein this setting poor compatibility, error-prone

Published 82 original articles · won praise 328 · views 220 000 +

Guess you like

Origin blog.csdn.net/qq_43733123/article/details/104979103
Recommended