我们在生产中使用NServiceBus,在日志文件中我们看到以下错误:
ERROR Our.Namespace.SomeMessageHandler [(null)] <(null)> - MethodName --> end with exception: NServiceBus.Unicast.Queuing.FailedToSendMessageException: Failed to send message to address: our.namespace.worker@somemachinename ---> System.Messaging.MessageQueueException: Cannot enlist the transaction.
at System.Messaging.MessageQueue.SendInternal(Object obj, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
at NServiceBus.Unicast.Queuing.Msmq.MsmqMessageSender.NServiceBus.Unicast.Queuing.ISendMessages.Send(TransportMessage message, Address address)
--- End of inner exception stack trace ---
at NServiceBus.Unicast.Queuing.Msmq.MsmqMessageSender.ThrowFailedToSendException(Address address, Exception ex)
at NServiceBus.Unicast.Queuing.Msmq.MsmqMessageSender.NServiceBus.Unicast.Queuing.ISendMessages.Send(TransportMessage message, Address address)
at NServiceBus.Unicast.UnicastBus.SendMessage(List`1 addresses, String correlationId, MessageIntentEnum messageIntent, Object[] messages)
at NServiceBus.Unicast.UnicastBus.SendMessage(Address address, String correlationId, MessageIntentEnum messageIntent, Object[] messages)
at NServiceBus.Unicast.UnicastBus.NServiceBus.IBus.Send(Address address, Object[] messages)
at Our.Namespace.SomeMessageHandler.MethodName(EventLogVO eventLog, IApplicationContext applContext, CreateEventLogHistory message)目标机器上的队列存在(双重检查)。奇怪的是,它并不总是发生在发送到该队列的每条消息上,而是偶尔发生(这意味着有到达该队列的消息)。
但没有找到类似的案子。
我在这里错过了什么?
发布于 2014-09-29 22:52:41
最近发生了此错误,并将其跟踪为以下内容之一:
我会试图找到真正的来源(希望你能从上面得到一些想法)。但是,如果所有这些都失败了,那么首先打开System.Transactions日志,看看它是否真的是一个超时。如果是,那么在本节中使用app.config
发布于 2014-12-30 15:09:05
我在一个花了一分钟时间完成的处理程序中发生了这种情况,最后通过将它添加到app.config中来增加超时。
<system.transactions>
<defaultSettings timeout="00:05:00"/>
</system.transactions>如下所示:https://erictummers.wordpress.com/2014/05/28/cannot-enlist-the-transaction/
此外,我还根据以下文章更改了机器配置:http://blogs.msdn.com/b/ajit/archive/2008/06/18/override-the-system-transactions-default-timeout-of-10-minutes-in-the-code.aspx
我还编写了一个编辑machine.configs:https://github.com/hfortegcmlp/MachineConfigEditor的快速应用程序
https://stackoverflow.com/questions/26083367
复制相似问题