Skip to content

kafka consumer seekToBeginning gap in committed offsets #3455

Description

@hfield-26

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:

  1. Consumer commits offset 100 (stored internally).
  2. seekToBeginning is triggered. Consumer resumes reading from offset 1.
  3. Consumer stops committing offsets entirely due to the internally stored offset.
  4. Only after reaching offset 100 again does the consumer resume committing.

This occurs when the latest or throttled commit-strategy is configured.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions