Reputation: 1436
I am new to kafka. I want to understand how kafka consumer behaves when offset specified by it is not present. Maybe the message at the given offset is deleted due to retention policy or consumer specified an invalid offset value.
Upvotes: 6
Views: 4232
Reputation: 3173
It depends on the auto.offset.reset's mode that you have configured. Please find below about what will happen with each mode when you seek to an offset that doesn't exist in the given topic's partition.
auto.offset.reset=earliest
auto.offset.reset=latest
auto.offset.reset=none
Upvotes: 5
Reputation: 654
Your consumer will use your auto.offset.reset
setting to reset its offset to a valid position. If no reset option has been specified, then the Broker will throw an InvalidOffsetException
.
Upvotes: 5