Problem description
When performing a seekToBeginning operation on a consumer, there is a gap in committed offsets until the previously largest offset is reached.
This is caused by the internal bookkeeping of the offset (see line 73 of KafkaLatestCommit): https://github.com/smallrye/smallrye-reactive-messaging/blob/main/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/commit/KafkaLatestCommit.java#L73
Example for illustration:
- Consumer commits offset 100 (stored internally).
seekToBeginning is triggered. Consumer resumes reading from offset 1.
- Consumer stops committing offsets entirely due to the internally stored offset.
- Only after reaching offset 100 again does the consumer resume committing.
This occurs when the latest or throttled commit-strategy is configured.
Problem description
When performing a
seekToBeginningoperation on a consumer, there is a gap in committed offsets until the previously largest offset is reached.This is caused by the internal bookkeeping of the offset (see line 73 of KafkaLatestCommit): https://github.com/smallrye/smallrye-reactive-messaging/blob/main/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/commit/KafkaLatestCommit.java#L73
Example for illustration:
seekToBeginningis triggered. Consumer resumes reading from offset 1.This occurs when the
latestorthrottledcommit-strategyis configured.