为了账号安全,请及时绑定邮箱和手机立即绑定

发送消息时出现服务总线未知错误 (0xffffffff)

发送消息时出现服务总线未知错误 (0xffffffff)

C#
侃侃尔雅 2022-12-24 12:16:15
我有一个连接到服务总线队列的 Azure App Service API。有一段时间一切都完美无缺,但后来我开始遇到这些错误:System.AggregateException: One or more errors occurred. (Unknown error (0xffffffff) ErrorCode: SocketError) ---> Microsoft.Azure.ServiceBus.ServiceBusCommunicationException: Unknown error (0xffffffff) ErrorCode: SocketError ---> System.Net.Sockets.SocketException: Unknown error (0xffffffff)   at Microsoft.Azure.ServiceBus.ServiceBusConnection.CreateConnectionAsync(TimeSpan timeout)   at Microsoft.Azure.Amqp.FaultTolerantAmqpObject`1.OnCreateAsync(TimeSpan timeout)   at Microsoft.Azure.Amqp.Singleton`1.GetOrCreateAsync(TimeSpan timeout)   at Microsoft.Azure.Amqp.Singleton`1.GetOrCreateAsync(TimeSpan timeout)   at Microsoft.Azure.ServiceBus.Amqp.AmqpLinkCreator.CreateAndOpenAmqpLinkAsync()   at Microsoft.Azure.ServiceBus.Core.MessageSender.CreateLinkAsync(TimeSpan timeout)   at Microsoft.Azure.Amqp.FaultTolerantAmqpObject`1.OnCreateAsync(TimeSpan timeout)   at Microsoft.Azure.Amqp.Singleton`1.GetOrCreateAsync(TimeSpan timeout)   at Microsoft.Azure.Amqp.Singleton`1.GetOrCreateAsync(TimeSpan timeout)   at Microsoft.Azure.ServiceBus.Core.MessageSender.OnSendAsync(IList`1 messageList)   --- End of inner exception stack trace ---   at Microsoft.Azure.ServiceBus.Core.MessageSender.OnSendAsync(IList`1 messageList)   at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)   at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)   at Microsoft.Azure.ServiceBus.Core.MessageSender.SendAsync(IList`1 messageList)    public async Task SendAsync(string message)    {        var queueMessage = new Message(Encoding.ASCII.GetBytes(message));        var queueClient = GetQueueClient("myqueue");        await queueClient.SendAsync(queueMessage);    }我认为这不是超出配额的问题,也没有说超时。关于如何调试这个的任何想法?
查看完整描述

2 回答

?
郎朗坤

TA贡献1921条经验 获得超9个赞

注意:这不一定能解决您的问题(因为错误的描述性不强)。

使用 ASB 消息传递的最佳实践之一是重用工厂和客户端

建议您在发送消息后不要关闭消息工厂或队列、主题和订阅客户端,然后在发送下一条消息时重新创建它们。

您可能只是遇到了某种连接限制,可以通过重用QueueClient而不是在每次发送消息时重新创建它来解决。


查看完整回答
反对 回复 2022-12-24
?
幕布斯7119047

TA贡献1794条经验 获得超8个赞

我自己昨天才开始得到很多这些:

Microsoft.ServiceBus: 未知错误 (0xffffffff)

无法连接到 net.tcp://some-namespace.servicebus.windows.net:9354/。连接尝试持续了 00:00:00 的时间跨度。TCP 错误代码 -1:未知错误 (0xffffffff)。

如您所见,连接尝试直接失败。

几个月来一直工作正常,然后砰……我猜微软又做了什么。他们的 Azure Status 板全是绿色,但我的函数有 60% 的失败率。


查看完整回答
反对 回复 2022-12-24
  • 2 回答
  • 0 关注
  • 118 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信