Application for viewing Azure service bus dead letters

2.4k views Asked by At

I've been looking around the web and GitHub for an off-the-shelf dead letter viewer for Azure service bus. This is to allow our DevOps team to monitor, view and report on any dead letters for each subscription for each topic on our bus.

I thought this would be a common application to hand out to DevOps, so believed there to one already out there. So before I start to role my own windows form app, is there an existing viewer out there that I might have missed ?

3

There are 3 answers

1
MrDeveloper On BEST ANSWER

After a few creative searches later, I have found the project "Service Bus Explorer" by Paolo Salvatori that does exactly what I need. I hope this helps out other people searching for the same thing.

It can be found on the code.msdn.microsoft.com site under Microsoft Azure and Sample code.

https://code.msdn.microsoft.com/windowsazure/Service-Bus-Explorer-f2abca5a

0
Serverless360 On

"A simple console app can be very helpful to you in achieving your goal of viewing the dead letter messages in your Service Bus Queue or Topic Subscription. The only thing you need to do is to receive the messages from the dead letter path of your Queue or Topic Subscription in peeklock mode and Display the required message details.

Here is a code to simple console app to display the deadletter messages.

using System;
using System.Threading.Tasks;
using Microsoft.ServiceBus.Messaging;

namespace DeadLetterQueue
{
    class Program
    {
        /*Supply the connection string of your Service Bus Namespace here*/
        const string connectionString = "connection string of your Service Bus Namespace";
        /*Supply the Name of your Service Bus Entity */
        const string entityName = "Entity Name";
        /*Supply the Number of deadletter messages you need to retrieve from your Entity here*/
        const int numberOfMessages = 5;
        static void Main(string[] args)
        {
            ViewDeadLetterMessages().GetAwaiter().GetResult();
            Console.ReadKey();
        }
        static async Task ViewDeadLetterMessages()
        {
              MessagingFactory messageFactory = MessagingFactory.CreateFromConnectionString(connectionString);
              Console.WriteLine(""DeadLetter Messages of {0}"", entityName);
              //Getting the deadletter path of the Service Bus Entity
              string _path = QueueClient.FormatDeadLetterPath(queueName);
              for (int i = 0; i < numberOfMessages; i++)
              {
                    var queueClient = await messageFactory.CreateMessageReceiverAsync(_path, ReceiveMode.PeekLock);
                    BrokeredMessage _message = await queueClient.ReceiveAsync();
                    Console.WriteLine(""MessageId Message {0} - {1} "", i, _message.MessageId);
                    _message.Complete();
                    _message.Abandon();
              }
          }          
     }
}
0
Chaithu Narayana On

While the "Service Bus Explorer" by Paolo Salvatori is a great UI tool for administering and interacting with messaging entities, basic operations such as send/receive/peek can now be handled directly from the Azure portal itself.

The Azure portal now offers a service bus explorer (preview) tool to perform basic operations (such as Send, Receive, Peek) on Queues/Topics and their dead-letter subentities, right from the portal itself. Check this link on detailed instructions about using this tool - azure-service-bus-message-explorer.

Also, refer to my answer to How to peek the deadletter messages