-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix: Save lock-token from receive_deferred_messages
AMQP payload, into ServiceBusReceivedMessage
#42471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: Save lock-token from receive_deferred_messages
AMQP payload, into ServiceBusReceivedMessage
#42471
Conversation
…an be used as the message's lock_token property. This allows the deferred message to be correctly renewed or settled (abandoned, completed, deferred again).
Thank you for your contribution @ashleysommer! We will review the pull request and get back to you soon. |
@microsoft-github-policy-service agree |
…ived lock token in the constructor Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
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 bug where deferred Service Bus messages were not properly retaining their lock tokens from the AMQP payload, preventing proper message renewal and settlement operations. The fix ensures that when receiving deferred messages, the lock token from the AMQP response is correctly extracted and assigned to the ServiceBusReceivedMessage
object.
Key changes:
- Extract lock token from AMQP payload for deferred messages in both transport implementations
- Store the received lock token in the message object during initialization
- Update the lock_token property to prioritize the received lock token over the delivery tag
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
File | Description |
---|---|
_uamqp_transport.py |
Extract lock token from deferred message AMQP payload and pass to message constructor |
_pyamqp_transport.py |
Extract lock token from deferred message AMQP payload and pass to message constructor |
message.py |
Store received lock token and prioritize it in the lock_token property |
Description
Save lock-token from
receive_deferred_messages
AMQP payload, so it can be used as the message'slock_token
property. This allows the deferred message to be correctly renewed or settled (abandoned, completed, deferred again).Fixes #42454
All SDK Contribution checklist:
Testing Guidelines
This is for initial review. I have not included anything in Changelog.
There are no tests at all in the codebase for deferred messages or anything to do with parsing deferred messages, so I don't know where to add a regression test for this.