7

我正在使用代码片段将消息发送到服务总线主题。

        try
        {
            // sb is instance of ServiceBusConfig.GetServiceBusForChannel
            await sb.SendAsync(message);
        }
        catch (Exception ex)
        {
            this.logger.LogError(
                "chanel",
                "An error occurred while sending a notification: " + ex.Message,
                ex);
            throw;
        }

和实施是

    public async Task SendAsync(BrokeredMessage message)
    {
        if (this.topicClient == null)
        {
            this.topicClient = TopicClient.CreateFromConnectionString(this.primaryConnectionString, this.topicPath);
            this.topicClient.RetryPolicy = this.retryPolicy;
        }

        await this.topicClient.SendAsync(message);
    }

错误:-

"ErrorCode,12005,Message,""发送通知时出错:操作未在分配的 00:01:00 超时内完成。分配给此操作的时间可能是较长超时的一部分。对于有关异常类型和正确异常处理的更多信息,Exception,""Microsoft.ServiceBus.Messaging.MessagingException:操作未在分配的 00:01:00 超时内完成。分配给此操作的时间可能是更长的超时时间。

有关异常类型和正确异常处理的更多信息

4

1 回答 1

1

这种情况偶尔会发生。Azure 可以随意更改和转移其底层硬件。这类错误时不时会出现。只要您在适当的地方有一些适当的重试逻辑,消息最终会通过......

于 2017-02-21T06:07:43.293 回答