如何解决EasyNetQ发布错误:消息:System.TimeoutException:发布者在等待序列号的ACK或NACK 4秒后确认超时
在生产环境中(RabbitMQ,Publisher控制台应用程序,在Azure中的同一VM中运行的订阅者控制台应用程序),我们始终看到此错误。 在dev / qa环境中看不到它。 我已经在Google的RabbitMQ和EasyNetQ组上发布了这个问题。
兔子MQ设置
- RabbitMQ:3.8.3。
- Erlang:22.3
- EasyNetQ:3.6.0
EasyNetQ设置
持久消息,PublishConfirm,持久队列
<add key="Queue.ConnectionString" value="host=localhost;virtualHost=/; username=guest; password=guest;timeout=5; publisherConfirms=true" />
_exchange = _advancedBus.ExchangeDeclare(exchange,ExchangeType.Topic,durable: true);
_messageQueue = _advancedBus.QueueDeclare(queue,durable: true);
天蓝色设置
问题上下文
Here,它表示“发布确认”是来自代理的确认,即邮件已持久保存到磁盘。 如果是这样,则EasynetQ的连接字符串中的超时与此有关。 另外,我们将其设置为5秒,如您在连接字符串中在上面看到的那样,但是正如您在下面的日志中看到的那样,它说它在等待ACK或NACK 4秒钟后超时。我很困惑。
错误说明
我们经常在生产环境中出现此错误
11/4/2020 6:50 AM: Message:System.TimeoutException: Publisher confirms timed out after 4 seconds waiting for ACK or NACK from sequence number 240019
at EasyNetQ.Producer.PublishConfirmationWaiter.Wait(TimeSpan timeout)
at EasyNetQ.RabbitAdvancedBus.Publish(IExchange exchange,String routingKey,Boolean mandatory,MessageProperties messageProperties,Byte[] body)
11/4/2020 6:50 AM: Message:System.TimeoutException: Publisher confirms timed out after 4 seconds waiting for ACK or NACK from sequence number 240017
at EasyNetQ.Producer.PublishConfirmationWaiter.Wait(TimeSpan timeout)
at EasyNetQ.RabbitAdvancedBus.Publish(IExchange exchange,Byte[] body)
当我查看RabbitMq日志时,我看到了。
2020-11-03 20:16:03.373 [error] <0.706.0> handle.exe output did not contain a line beginning with ' File ',unable to determine used file descriptor count: "
Nthandle v4.22 - Handle viewer
copyright (C) 1997-2019 Mark Russinovich
Sysinternals - www.sysinternals.com
Handle type summary:
ALPC Port : 1
Desktop : 1
Directory : 2
EtwRegistration : 41
Event : 273
Event : 55
Event : 1
IoCompletion : 3
IRTimer : 4
Key : 8
Process : 4
Semaphore : 12
Thread : 81
TpWorkerFactory : 2
WaitCompletionPacket: 5
WindowStation : 2
Total handles: 495
"
我不是专家。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。