Skip to content

Fix DLQ reason and description not transmitted in ServiceBus binder#49663

Merged
rujche merged 1 commit into
mainfrom
rujche/main/fix-DLQ-reason-and-description-not-working-in-spring-cloud-azure-stream-binder-servicebus
Jun 29, 2026
Merged

Fix DLQ reason and description not transmitted in ServiceBus binder#49663
rujche merged 1 commit into
mainfrom
rujche/main/fix-DLQ-reason-and-description-not-working-in-spring-cloud-azure-stream-binder-servicebus

Conversation

@rujche

@rujche rujche commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove the redundant no-arg messageContext.deadLetter() call in ServiceBusMessageChannelBinder.deadLetter(...).
  • Keep only messageContext.deadLetter(options) so the dead-letter reason and error description are applied correctly.
  • Strengthen regression test to verify the no-arg overload is never invoked.

Root Cause

The no-arg deadLetter() settled the message before the parameterized deadLetter(options) call executed, so DLQ reason/description were not transmitted.

Changes

  • ServiceBusMessageChannelBinder: deleted the no-arg dead-letter call.
  • ServiceBusMessageChannelBinderTest: added verify(messageContext, never()).deadLetter().

Verification

  • Ran:
    • mvn -pl sdk/spring/spring-cloud-azure-stream-binder-servicebus -Dtest=ServiceBusMessageChannelBinderTest test -DskipITs
  • Result:
    • BUILD SUCCESS
    • Tests run: 3, Failures: 0, Errors: 0

Fixes #41883

@rujche rujche self-assigned this Jun 29, 2026
@rujche rujche moved this to In Progress in Spring Cloud Azure Jun 29, 2026
@rujche rujche added this to the 2026-07 milestone Jun 29, 2026
@rujche rujche added azure-spring All azure-spring related issues azure-spring-servicebus Spring service bus related issues. and removed Created By Copilot labels Jun 29, 2026
@rujche rujche marked this pull request as ready for review June 29, 2026 02:16
Copilot AI review requested due to automatic review settings June 29, 2026 02:16
@rujche rujche requested review from a team, Netyyyy, moarychan and saragluna as code owners June 29, 2026 02:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a regression in the Spring Cloud Azure Service Bus Stream Binder where dead-letter reason and error description were not being transmitted because the message was being settled by an earlier no-arg deadLetter() call before deadLetter(options) could apply the options.

Changes:

  • Removed the redundant no-arg deadLetter() invocation so only deadLetter(DeadLetterOptions) is used.
  • Strengthened the regression test to assert the no-arg overload is never called and that there are no unexpected interactions.
  • Added a Spring module changelog entry documenting the bug fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
sdk/spring/spring-cloud-azure-stream-binder-servicebus/src/main/java/com/azure/spring/cloud/stream/binder/servicebus/implementation/ServiceBusMessageChannelBinder.java Removes the premature no-arg dead-letter settlement so reason/description can be applied via DeadLetterOptions.
sdk/spring/spring-cloud-azure-stream-binder-servicebus/src/test/java/com/azure/spring/cloud/stream/binder/servicebus/implementation/ServiceBusMessageChannelBinderTest.java Adds assertions ensuring deadLetter() (no-arg) is never invoked and no extra interactions occur.
sdk/spring/CHANGELOG.md Documents the regression fix under the unreleased Spring Cloud Azure Stream Binder Service Bus section.

@sunghyun1999

sunghyun1999 commented Jun 29, 2026

Copy link
Copy Markdown

Hi @rujche, thanks for picking this up! Since this fix originated from my PR #49662, would you mind adding a Co-authored-by trailer to credit the original contribution? Thanks!

Co-authored-by: sunghyun1999 <32184099@dankook.ac.kr>

@rujche rujche force-pushed the rujche/main/fix-DLQ-reason-and-description-not-working-in-spring-cloud-azure-stream-binder-servicebus branch from aa74fa4 to 17f5992 Compare June 29, 2026 02:44
- remove redundant no-arg deadLetter() call so DeadLetterOptions is applied

- strengthen regression test to guard against extra settlement interactions

- update spring changelog for issue #41883

Co-authored-by: sunghyun1999 <32184099@dankook.ac.kr>
@rujche rujche force-pushed the rujche/main/fix-DLQ-reason-and-description-not-working-in-spring-cloud-azure-stream-binder-servicebus branch from 17f5992 to 22edff0 Compare June 29, 2026 02:45
@rujche

rujche commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

Hi @rujche, thanks for picking this up! Since this fix originated from my PR #49662, would you mind adding a Co-authored-by trailer to credit the original contribution? Thanks!

Co-authored-by: sunghyun1999 <32184099@dankook.ac.kr>

@sunghyun1999 commit message updated:

image

@rujche rujche merged commit 31fff02 into main Jun 29, 2026
32 checks passed
@rujche rujche deleted the rujche/main/fix-DLQ-reason-and-description-not-working-in-spring-cloud-azure-stream-binder-servicebus branch June 29, 2026 06:22
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Spring Cloud Azure Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azure-spring All azure-spring related issues azure-spring-servicebus Spring service bus related issues.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[BUG] DLQ reason and description not working in spring-cloud-azure-stream-binder-servicebus

4 participants