Skip to content

Kafka handle position and commit offset on seek operations#3453

Open
ozangunalp wants to merge 4 commits into
smallrye:mainfrom
ozangunalp:kafka_commit_offsets_seek
Open

Kafka handle position and commit offset on seek operations#3453
ozangunalp wants to merge 4 commits into
smallrye:mainfrom
ozangunalp:kafka_commit_offsets_seek

Conversation

@ozangunalp

Copy link
Copy Markdown
Collaborator
  • Latest commit strategy: clear offsets on partition revocation
  • Added clearBuffer to the PausableChannel interface
  • Added onPartitionsSeeked callback to KafkaConsumerRebalanceListener and partitionsSeeked to KafkaCommitHandler interface. On seek operations, the Kafka consumer clears the poller buffer and calls partitionsSeeked on commit handlers.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.39216% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.90%. Comparing base (a96442f) to head (3c58ca8).
⚠️ Report is 1206 commits behind head on main.

Files with missing lines Patch % Lines
...ve/messaging/kafka/impl/ReactiveKafkaConsumer.java 50.00% 2 Missing and 2 partials ⚠️
...ive/messaging/kafka/impl/OrderedStreamHandler.java 0.00% 2 Missing ⚠️
.../providers/extension/PausableChannelDecorator.java 0.00% 2 Missing ⚠️
...o/smallrye/reactive/messaging/PausableChannel.java 0.00% 1 Missing ⚠️
...essaging/kafka/KafkaConsumerRebalanceListener.java 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #3453      +/-   ##
============================================
+ Coverage     77.47%   77.90%   +0.43%     
- Complexity     3778     5619    +1841     
============================================
  Files           306      486     +180     
  Lines         12673    18755    +6082     
  Branches       1648     2308     +660     
============================================
+ Hits           9818    14612    +4794     
- Misses         2116     3006     +890     
- Partials        739     1137     +398     
Files with missing lines Coverage Δ
...ive/messaging/kafka/commit/KafkaCommitHandler.java 100.00% <100.00%> (ø)
...tive/messaging/kafka/commit/KafkaLatestCommit.java 100.00% <100.00%> (ø)
...ka/commit/KafkaThrottledLatestProcessedCommit.java 91.42% <100.00%> (+0.20%) ⬆️
...ctive/messaging/kafka/impl/RebalanceListeners.java 92.18% <100.00%> (+6.22%) ⬆️
...o/smallrye/reactive/messaging/PausableChannel.java 0.00% <0.00%> (ø)
...essaging/kafka/KafkaConsumerRebalanceListener.java 40.00% <0.00%> (+15.00%) ⬆️
...ive/messaging/kafka/impl/OrderedStreamHandler.java 82.72% <0.00%> (ø)
.../providers/extension/PausableChannelDecorator.java 85.71% <0.00%> (ø)
...ve/messaging/kafka/impl/ReactiveKafkaConsumer.java 80.45% <50.00%> (-1.50%) ⬇️

... and 278 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

When seek(), seekToBeginning(), or seekToEnd() is called on the consumer, reset the commit handler's per-partition offset tracking.
@ozangunalp ozangunalp force-pushed the kafka_commit_offsets_seek branch from 73b713b to 3c58ca8 Compare June 23, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant