gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 21:53:09 25 4
gpt4 key购买 nike

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

        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,""An error occurred while sending a notification: The operation did not complete within the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout. For more information on exception types and proper exception handling, Exception,""Microsoft.ServiceBus.Messaging.MessagingException: The operation did not complete within the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout.

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

最佳答案

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

关于c# - 操作未在分配的超时 00 :01:00 内完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38653126/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com