Skip to content

Fix/3350 dlq publication failure - #3352

Open
itsgourav62 wants to merge 2 commits into
spring-cloud:mainfrom
itsgourav62:fix/3350-dlq-publication-failure
Open

itsgourav62 wants to merge 2 commits into
spring-cloud:mainfrom
itsgourav62:fix/3350-dlq-publication-failure

Conversation

@itsgourav62

@itsgourav62 itsgourav62 commented Nov 28, 2026 •

Copy link
Copy Markdown

Summary

Fixes #3350.

The Kafka binder currently catches and logs exceptions raised during Dead Letter Queue (DLQ) publication without propagating the failure. This can cause a failed DLQ recovery operation to be treated as successful, potentially allowing the original Kafka record to be acknowledged or its offset to be committed even though the record was not successfully published to the DLQ.

This change ensures that DLQ publication failures are propagated to the caller so that failed recovery operations are not silently treated as successful.

Changes

  • Propagates synchronous and asynchronous DLQ publication failures to the caller.
  • Waits for asynchronous DLQ send completion and detects failures within the configured send timeout.
  • Prevents manual and manual-immediate acknowledgment when DLQ publication fails.
  • Preserves acknowledgment behavior when DLQ publication succeeds.
  • Restores the thread's interrupt status when DLQ publication waiting is interrupted.
  • Adds regression tests covering asynchronous send failures and synchronous producer exceptions.
  • Verifies that manual acknowledgment is not performed when DLQ publication fails.

Testing

Executed the full Kafka binder module test suite:

mvn -pl binders/kafka-binder/spring-cloud-stream-binder-kafka -am test

Test results:

  • Tests run: 198
  • Failures: 0
  • Errors: 0
  • Skipped: 12
  • Build: SUCCESS

Related issue

Closes #3350.

Signed-off-by: Gourav Shaw <shawgourav62@gmail.com>
Signed-off-by: Gourav Shaw <shawgourav62@gmail.com>
@itsgourav62
itsgourav62 force-pushed the fix/3350-dlq-publication-failure branch from 17408c2 to ad24462 Compare November 28, 2026 12:04
@olegz

olegz commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Thanks for the report and the PR. The failure mode described here, where a failed DLQ publication still lets the offset be committed, is a real concern and we are reviewing it. Because it changes redelivery behavior when the DLQ is unavailable, we'll go through it carefully, including the manual-ack paths, before merging.

This branch has not been deployed

No deployments
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.

Kafka binder skips failed input records when DLQ publication fails

2 participants