【问题标题】:Microsoft.Azure.ServiceBus.ServiceBusException - Sending a message to the Azure service bus topic queueMicrosoft.Azure.ServiceBus.ServiceBusException - 向 Azure 服务总线主题队列发送消息
【发布时间】:2019-01-14 11:50:38
【问题描述】:

我的应用程序中有以下代码 sn-p 用于向 Azure 服务总线主题队列发送消息。在发送消息期间,我随机得到了通用的 ServiceBusException。

     var serialized = JsonConvert.SerializeObject(message);
     var _client = new TopicClient(connectionString, $"{queuePrefix}{queueName}");

        var m = new Message(Encoding.ASCII.GetBytes(serialized))
        {
            MessageId = messageId,
            ContentType = "application/json"
        };

        await RetryHelper.WithRetries(async () =>
        {
            await _client.SendAsync(m);
        }, new Common.RetryPolicy(3, TimeSpan.Zero, typeof(ServiceBusTimeoutException)));

这是我的异常消息,

服务无法处理请求;请重试操作。有关异常类型和正确异常处理的更多信息,请参阅http://go.microsoft.com/fwlink/?LinkId=761101TrackingId:24e3ca8e-a74f-4f1b-a0e6-acf4e98a0bdc_G9, SystemTracker:client-link78653, Timestamp:2019-01-06T01:35:50

Microsoft.Azure.ServiceBus.ServiceBusException

由于该异常并不具体如本页所列 - https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-exceptions,我发现很难理解异常的根本原因并采取纠正措施。

如果有任何信息可以进一步调查,我将不胜感激。

【问题讨论】:

    标签: azure-service-fabric azure-servicebus-queues azure-servicebus-topics


    【解决方案1】:

    ServiceBusException 是所有其他异常的基本异常。发生在代理端的错误会被发回并翻译。在这种情况下,它不能转换为documentation 中描述的最常见错误。在这种情况下,重新绑定是正确的做法,因为异常是间歇性的。话虽如此,要考虑的事情很少。

    • 默认情况下,客户端内部使用RetryPolicy,正在重试发送操作。如果可能的话,应在一段时间后进行重试。
    • 在标准层上运行可能可能会遭受更高的异常率,但您会看到ServerBusyException
    • 与异常一起提供的TrackingId 代码可用于打开支持案例以开始调查并更好地了解发生了什么。

    建议联系支持人员并提供您必须提供的跟踪 ID,以帮助您了解为什么经常看到此错误。

    【讨论】:

    • 谢谢,我会提出请求以支持我的跟踪 ID,以接收他们的想法。如果不麻烦的话,可以指点我到论坛提出我的要求吗? (对不起,我以前没有这样做过)
    • 通过门户:azure.microsoft.com/en-ca/support/options 或 Twitter:查看 Azure 支持 (@AzureSupport):twitter.com/AzureSupport
    猜你喜欢
    • 2012-08-28
    • 1970-01-01
    • 1970-01-01
    • 2018-12-07
    • 2019-09-18
    • 2021-05-23
    • 2013-03-19
    • 1970-01-01
    • 2016-02-25
    相关资源
    最近更新 更多