When creating a new consumer for new topic and starting consuming it starts off from latest offset. For example we have 10 message in single partition topic then we wait for 11th message when starting to consume.
I use Offset.Stored value for this and further in the process I manually commit messages. So, how can I default to 0 offset commit? There were no previous manual commits made. So just a fresh topic where message was only published.
Maybe there are some configuration parameters in the cluster or topic level which I should do to achieve wanted behavior?
Publish 10 messages to new topic (no consumers, yet), then after I've published it I start consuming and start off on 10th message. Expected behavior would be to start consuming from 0.
Please provide the following information:
Set the topic-level configuration property auto.offset.reset to earliest to make the Consumer starts from the earliest available offset when there is no usable committed offset.
Most helpful comment
Set the topic-level configuration property
auto.offset.resettoearliestto make the Consumer starts from the earliest available offset when there is no usable committed offset.