Skip to content

GH-4380: Add AcknowledgementCommitCallback support for async share co…#4390

Merged
artembilan merged 1 commit into
spring-projects:mainfrom
maxwell-balla:GH-4380
Apr 10, 2026
Merged

GH-4380: Add AcknowledgementCommitCallback support for async share co…#4390
artembilan merged 1 commit into
spring-projects:mainfrom
maxwell-balla:GH-4380

Conversation

@maxwell-balla

Copy link
Copy Markdown
Contributor

Fixes #4380

Following up on #4379 (async commit option), this PR adds
AcknowledgementCommitCallback support to the share consumer container.

When syncShareCommits=false, a default callback is registered that logs
commit failures. Users can provide a custom callback via
ContainerProperties.setAcknowledgementCommitCallback() for custom error
handling.

Changes:

  • ContainerProperties: added acknowledgementCommitCallback field with setter/getter
  • ShareKafkaMessageListenerContainer: register the callback on the ShareConsumer
    before subscribe(), with a default logging callback for async mode

@maxwell-balla maxwell-balla force-pushed the GH-4380 branch 2 times, most recently from 11e62f7 to 6b48049 Compare April 7, 2026 11:32

@artembilan artembilan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxwell-balla ,

Change order of import in ShareKafkaMessageListenerContainer…

please, consider to run ./gradlew check and fix all the failures locally before pushing to the remote branch.
All of those Checkstyle violations feels like your PR is not ready for review.

@artembilan artembilan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update!
Let's see if my review makes sense!

… async share consumer commits

Wire AcknowledgementCommitCallback into the share consumer container
to provide visibility into async commit success or failure.

When syncShareCommits=false, a default callback is registered that logs
commit failures. Users can also provide a custom callback via
ContainerProperties.setAcknowledgementCommitCallback() for custom error
handling or coordination with external systems.

Changes:
- ContainerProperties: added acknowledgementCommitCallback field, setter and getter
- ShareKafkaMessageListenerContainer: register the callback on the ShareConsumer
  before subscribe, with a default logging callback for async mode

Fixes spring-projectsgh-4380

Signed-off-by: Maxwell Balla <ballamaxwell7@gmail.com>
@artembilan artembilan merged commit 51427d9 into spring-projects:main Apr 10, 2026
3 checks passed
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.

Add AcknowledgementCommitCallback support for async share consumer commits

2 participants