Skip to content

dead-letter reason not populated into error.info when a message is rejected #155

@yunhaoling

Description

@yunhaoling

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:

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions