An Azure service that provides cloud messaging as a service and hybrid integration.
@Jorge Ramirez Duran Welcome to Microsoft Q&A Forum, Thank you for posting your query here!
When Does message go to dead-letter queue ?
There are several activities in Service Bus that cause messages to get pushed to the DLQ from within the messaging engine itself. An application can also explicitly move messages to the DLQ. The following two properties (dead-letter reason and dead-letter description) are added to dead-lettered messages. Applications can define their own codes for the dead-letter reason property, but the system sets the following values.
More info about time to live and Maximum delivery count is here.
How to view the messages in Dead-letter queue ?
- Using ServiceBus Explorer
You can use the Service Bus Explorer . Once you have downloaded and installed the tool, you can connect to your Azure Service Bus namespace and navigate to the DLQ of the queue or subscription that you are interested in. You can then view the messages in the DLQ and their properties, such as the message ID, sequence number, content type, and delivery count. You can also manually dead-letter or resubmit messages from the DLQ.
In the below screenshot, Service Bus Explorer shows that there are 62 messages currently in the DLQ for the subscription "test1".
- Using Azure CLI:
You can also get the count of DLQ messages by using Azure CLI command:az servicebus topic subscription show. Refer this article. - Using SDK: To get the numbner of dead-lettered messages in the entity you can rely on the MessageCountDetails.DeadLetterMessageCount Property. Refer sample code here.
Using Azure portal Metrics:
You can navigate to the Azure Service Bus Namespace --> Metrics --> Then add the metrics for the Count of deadletter queue and ap[ply splitting at the entity level as shown below:
**
**
How to identify the reason for the message getting deadlettered ?**
Navigate to your Service Bus queue. Select Service Bus Explorer --> Click on Dead-letter and you can see the Dead letter Reason and Dead Letter Error Description as shown below:
I hope this information helps you get the detailed information you need about the messages in the DLQ of your Azure Service Bus Queues. Let me know if you have any further questions or concerns.
**
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.