How to get detailed information about the messages in the DLQ

Jorge Ramirez Duran 0 Reputation points
2023-08-16T07:28:39.19+00:00

On production we currently have about 20-30 Azure service bus Queues and some of them holds messages on it's dependand Dead-Letter Queue, We've no info about those messages, for example when were placed on the DLQ, I'm needed to generate some kind of report saying how often those messages are placed there, or at least to create a list containing the date each message reached the DLQ (then I can use excel to group the report data), is this possible throught the portal? SDK? Command line? or any kind of workaround would be appreciated.

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
704 questions
{count} votes

2 answers

Sort by: Most helpful
  1. JananiRamesh-MSFT 29,276 Reputation points
    2023-08-16T09:19:28.9133333+00:00

    Hi
    Jorge Ramirez Duran
    Thanks for reaching out. You can view the details for deadletter meaages using ServiceBus explorer

    Latest Source Binaries

    https://github.com/paolosalvatori/ServiceBusExplorer

    Download at this link. It is standalone so no installation is required, just unzip and run it.

    https://github.com/paolosalvatori/ServiceBusExplorer/releases

    Step 1: Go to the corresponding namespace in the Azure Portal. Click on Settings-> Shared Access Policies and double click on RootManageSharedAccessKey. Copy the Connection string-primary key and keep this value handy.
    NOTE: You have to use a connection string with Manage Claims with Service Bus Explorer.

    Step 2: Open ServiceBus Explorer go to file -> Connect --> In the Service Bus Namespace dropdown menu, choose "Enter connection string" and add your Connection string-primary key from step 1 and click on "OK."

    Step 3: Once you have successfully connected to your Service Bus namespace, select one of your queues and the middle value shows the no of dead letter messages in your queue as shown below

    User's image

    Click the "Deadletter" button at the bottom

    User's image

    Select "Peek" to peek some messages from the deadletter and click "Ok" You can then review the deadletter reason, Enqueued time for each individual message as shown below, you can also download the message details by clicking "save selected messages".
    User's image

    Hope this helps!

    please let me know incase of further queries, I would be glad to help you.

    Please do "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


  2. navba-MSFT 27,550 Reputation points Microsoft Employee Moderator
    2023-08-16T09:43:59.5966667+00:00

    @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.

    • User's image

    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".

    User's image

    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:

    enter image description here

    **

    **

    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:

    User's image

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.