【问题标题】:Application for viewing Azure service bus dead letters查看Azure服务总线死信的申请
【发布时间】:2015-09-02 11:28:25
【问题描述】:

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

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

【问题讨论】:

    标签: azure azureservicebus dead-letter


    【解决方案1】:

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

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

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

    【讨论】:

    【解决方案2】:

    “一个简单的控制台应用程序可以帮助您实现在服务总线队列或主题订阅中查看死信消息的目标。您唯一需要做的就是从死信路径接收消息在 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();
                  }
              }          
         }
    }
    

    【讨论】:

      【解决方案3】:

      虽然"Service Bus Explorer" by Paolo Salvatori 是用于管理消息实体并与消息实体交互的出色 UI 工具,但现在可以直接从 Azure 门户本身处理发送/接收/查看等基本操作。

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

      另外,参考我对How to peek the deadletter messages的回复

      【讨论】:

        猜你喜欢
        • 2017-07-01
        • 2018-04-01
        • 2020-09-20
        • 2014-12-09
        • 2016-05-13
        • 2018-11-10
        • 2017-08-13
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多