如何解决将 Rebus 从 0.71.4 升级到 0.75.2 后的 RabbitMq 连接问题



Rebus 从 0.71.4 升级到 0.75.2 后如何解决 RabbitMq 连接问题?

我们有一个分布式处理器设置,其中 N 个仪表板用于监视活动,一个管理器用于控制工作流,N 个工作人员用于执行工作。每个组件之间的通信使用 RabbitMq 进行管理。一切都运行良好[在Rebus 0.71.4上],直到我们升级到Rebus 0.75.2(其中包括将RabbitMq.Client升级到3.4.0.0)。

管理器是最复杂的组件,因为它发送多种形式的通信,包括发布给工作人员的心跳、发布到仪表板的请求/响应审核消息,以及包括工作人员要执行的工作的消息。 所有这些消息传递都是同时完成的。

我们使用预取 1,以防止

工作线程上长时间运行的任务(作业范围在 1 秒到 5 分钟之间)而耽误工作。

现在,我们在管理器中的发布期间出现不稳定的异常。

2015-01-07 14:59:58.6205 | Error | An error occurred while rolling back the transaction! RabbitMQ.Client.Exceptions.AlreadyClosedException Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=504, text="CHANNEL_ERROR - unexpected command while processing 'tx.commit'", classId=60, methodId=40, cause= at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd) at RabbitMQ.Client.Impl.ModelBase.TransmitAndEnqueue(Command cmd, IRpcContinuation k) at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body) at RabbitMQ.Client.Framing.Impl.Model.TxRollback() at System.Action.Invoke() at Rebus.Bus.TxBomkarl.RaiseDoRollback() at Rebus.Bus.Worker.<TryProcessIncomingMessage>d__1d.MoveNext()

2015-01-07 14:59:58.6275 | Warn | User exception in Rebus 1 worker 1: Rebus.Bus.QueueCommitException: An exception occurred while attempting to commit the queue transaction ---> RabbitMQ.Client.Exceptions.OperationInterruptedException: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=504, text="CHANNEL_ERROR - unexpected command while processing 'tx.commit'", classId=60, methodId=40, cause= at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply() at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body) at RabbitMQ.Client.Framing.Impl.Model.TxCommit() at System.Action.Invoke() at Rebus.Bus.TxBomkarl.RaiseDoCommit() at Rebus.Bus.Worker.<TryProcessIncomingMessage>d__1d.MoveNext() --- End of inner exception stack trace --- at Rebus.Bus.Worker.<TryProcessIncomingMessage>d__1d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__0(Object state) at Rebus.Bus.RebusSynchronizationContext.Run() at Rebus.Bus.Worker.MainLoop()

这些是 RabbitMq 日志中的一些相关条目:

=ERROR REPORT==== 7-Jan-2015::15:41:54 === Error on AMQP connection <0.680.0> ([::1]:59429 -> [::1]:5672, vhost: 'efs', user: 'efs.eod', state: running), channel 1: {amqp_error,channel_error,"unexpected command while processing 'tx.commit'", 'basic.publish'}

=WARNING REPORT==== 7-Jan-2015::15:42:55 === closing AMQP connection <0.553.0> ([::1]:59421 -> [::1]:5672): connection_closed_abruptly

我们已经针对 RabitMq Server 3.3.5 和 3.4.3 进行了测试。

此行为是可重现的,但很零星。而且,当它正常运行时,通信速度比 0.71.4 慢得多。

迄今为止,我们无法孤立地重复这个问题。任何诊断问题的建议将不胜感激。

奇怪!我试图通过对 Rebus 的 RabbitMQ 传输进行各种预取计数来重现它,但到目前为止我还没有成功。

您能否向我描述有关您的设置的更多详细信息?或者,理想情况下,给我发送一个最小的复制品?

最新更新