简体   繁体   中英

How to Send message to Azure Service Bus Subscription Deadletter using Rest Api with deadletter Reason and Error Description?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM