Conversation
2 tasks
Contributor
There was a problem hiding this comment.
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 onlydeadLetter(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. |
aa74fa4 to
17f5992
Compare
- 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>
17f5992 to
22edff0
Compare
Member
Author
@sunghyun1999 commit message updated: |
moarychan
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
messageContext.deadLetter()call inServiceBusMessageChannelBinder.deadLetter(...).messageContext.deadLetter(options)so the dead-letter reason and error description are applied correctly.Root Cause
The no-arg
deadLetter()settled the message before the parameterizeddeadLetter(options)call executed, so DLQ reason/description were not transmitted.Changes
ServiceBusMessageChannelBinder: deleted the no-arg dead-letter call.ServiceBusMessageChannelBinderTest: addedverify(messageContext, never()).deadLetter().Verification
mvn -pl sdk/spring/spring-cloud-azure-stream-binder-servicebus -Dtest=ServiceBusMessageChannelBinderTest test -DskipITsBUILD SUCCESSTests run: 3, Failures: 0, Errors: 0Fixes #41883