I can't find an example of how to send a message to a Azure Service Bus Subscription DeadLetter using rest api. It appears that the suffix for the endpoint should be /Subscriptions//$deadletterqueue. However, I can't find an example of how to pass the deadletterReason, and the deadLetterErrorDescription. Is it be as simple as passing those values as message headers?

1

There are 1 answers

5
Sean Feldman On

Messages are not sent directly to the dead-letter queue by the client code (REST API or any other SDK). Instead, messages are dead-lettered by the broker when MaxDeliveryCount is exceeded and no more attempts to process the message can be made. That's when the broker will move the message to the dead-letter queue with the reason.

Not that there are also less common reasons, such as the number of hops (forwarding), expired time-to-live, etc. MaxDeliveryCount is the most common scenario.

Microsoft documentation will help in addition to this post.