3

我一直在网上和 GitHub 上寻找 Azure 服务总线的现成死信查看器。这是为了让我们的 DevOps 团队能够监控、查看和报告我们总线上每个主题的每个订阅的任何死信。

我认为这将是分发给 DevOps 的常见应用程序,因此相信已经存在的应用程序。所以在我开始扮演我自己的 Windows 窗体应用程序之前,是否有一个我可能错过的现有查看器?

4

3 回答 3

5

经过几次创造性的搜索后,我发现 Paolo Salvatori 的“Service Bus Explorer”项目正是我所需要的。我希望这可以帮助其他人寻找相同的东西。

它可以在 Microsoft Azure 和示例代码下的 code.msdn.microsoft.com 站点上找到。

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

于 2015-06-17T09:51:24.447 回答
1

虽然Paolo Salvatori 的“服务总线资源管理器”是用于管理消息实体并与消息实体交互的出色 UI 工具,但现在可以直接从 Azure 门户本身处理发送/接收/查看等基本操作。

Azure 门户现在提供服务总线资源管理器(预览版)工具,可直接从门户本身对队列/主题及其死信子实体执行基本操作(例如发送、接收、查看)。查看此链接,了解有关使用此工具的详细说明 - azure-service-bus-message-explorer

另外,请参阅我对如何查看死信消息的回答

于 2020-06-25T15:13:12.073 回答
1

“一个简单的控制台应用程序可以非常有助于您实现查看服务总线队列或主题订阅中的死信消息的目标。您唯一需要做的就是从队列的死信路径接收消息或 peeklock 模式下的主题订阅和显示所需的消息详细信息。

这是用于显示死信消息的简单控制台应用程序的代码。

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();
              }
          }          
     }
}
于 2018-06-15T00:47:10.953 回答