-
Notifications
You must be signed in to change notification settings - Fork 54
Description
In ServiceBus v0.50.2 and before, dead_letter doesn't populate the description to the service side when using message.reject() method.
This is because description is not populated into error.info, only populated in error.description:
azure-uamqp-python/src/vendor/azure-uamqp-c/src/messaging.c
Lines 181 to 198 in 8038104
| else | |
| { | |
| if ((error_description != NULL) && | |
| (error_set_description(error_handle, error_description) != 0)) | |
| { | |
| LogError("Cannot set error description on error AMQP value for REJECTED state"); | |
| error_constructing = true; | |
| } | |
| else | |
| { | |
| if (rejected_set_error(rejected, error_handle) != 0) | |
| { | |
| LogError("Cannot set error on REJECTED state handle"); | |
| error_constructing = true; | |
| } | |
| } | |
| error_destroy(error_handle); |
To populate the description properly, need to call error_set_info
| int error_set_info(ERROR_HANDLE error, fields info_value) |
Besides, there're other properties missed for ServiceBus: DeadLetterReason, propertiesToModify.
.Net AmqpReceiver in ServiceBus is doing this:
https://github.com/Azure/azure-sdk-for-net/blob/81d6ed42d456bbb3b02eeec8253f93fc1c519a3f/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpReceiver.cs#L584-L619
So one possible way to fix the issue is updating the underlying C API to making messaging_delivery_rejected accpet fields which is a type of AMQP_VALUE.
being
AMQP_VALUE messaging_delivery_rejected(const char* error_condition, const char* error_description, fields erorr_info)