Skip to content

GH-4439: Pass full record list to batch rollback processor#4443

Merged
sobychacko merged 1 commit into
spring-projects:mainfrom
nikita-kibitkin:GH-4439
May 29, 2026
Merged

GH-4439: Pass full record list to batch rollback processor#4443
sobychacko merged 1 commit into
spring-projects:mainfrom
nikita-kibitkin:GH-4439

Conversation

@nikita-kibitkin

Copy link
Copy Markdown
Contributor

Fixes #4439.

When a batch listener consumes the full ConsumerRecords, the container keeps recordList empty because the listener does not use the List<ConsumerRecord> path.

On rollback, that empty list was passed to the AfterRollbackProcessor, so the default processor had no records to seek. This change treats an empty recordList the same way as null and materializes it from the original ConsumerRecords.

I added a regression test for a transactional batch listener with wantsPollResult=true.

Tests:

  • ./gradlew :spring-kafka:checkstyleMain :spring-kafka:checkstyleTest
  • ./gradlew :spring-kafka:test --tests org.springframework.kafka.listener.ConcurrentMessageListenerContainerMockTests

…ollback

Signed-off-by: Nikita Kibitkin <nikita.n.kibitkin@gmail.com>
@sobychacko sobychacko merged commit 3a3be04 into spring-projects:main May 29, 2026
3 checks passed
spring-builds pushed a commit that referenced this pull request May 29, 2026
Fixes: #4439

Signed-off-by: Nikita Kibitkin <nikita.n.kibitkin@gmail.com>
(cherry picked from commit 3a3be04)
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.

DefaultAfterRollbackProcessor for batch-listeners consuming ConsumerRecords doesn't seek consumer

2 participants