操作未在分配的00:01:00超时内完成

Sud*_*ami 6 c# azure azureservicebus asp.net-web-api azure-servicebus-topics

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

        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;
        }
Run Code Online (Sandbox Code Playgroud)

和实施是

    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);
    }
Run Code Online (Sandbox Code Playgroud)

错误:-

"ErrorCode,12005,Message,""发送通知时发生错误:操作未在分配的超时00:01:00内完成.分配给此操作的时间可能是较长超时的一部分. .在异常类型和适当的异常处理,异常"" Microsoft.ServiceBus.Messaging.MessagingException更多信息:该操作没有的00:01:00在规定的超时时间内完成分配给此操作的时间可能是一部分更长的超时.

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

Ste*_*nar 2

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