NServiceBus unable to receive message

最后都变了- 提交于 2021-01-29 04:35:37

问题


I'm following the NServiceBus getting started guide (version 5) and I get the below error.

When the client sends a command to the server, the server has issues to receive the message. The code is okay, because the exact same code on another machine is working. So something is missing on my machine.

I did run this command as is mentioned in the tutorial:

DISM.exe /Online /NoRestart /English /Enable-Feature /all /FeatureName:MSMQ-Server

But it's still not working.

2016-11-01 19:50:47.316 ERROR ServiceBus.Transports.Msmq.MsmqDequeueStrategy Error in receiving messages. System.Transactions.TransactionAbortedException: The transaction has aborted. ---> System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException: The Transaction Manager is not available. (Exception from HRESULT: 0x8004D01B) at System.Transactions.Oletx.IDtcProxyShimFactory.ConnectToProxy(String nodeName, Guid resourceManagerIdentifier, IntPtr managedIdentifier, Boolean& nodeName Matches, UInt32& whereaboutsSize, CoTaskMemHandle& whereaboutsBuffer, IResourceManagerShim& resourceManagerShim) at System.Transactions.Oletx.DtcTransactionManager.Initialize() --- End of inner exception stack trace --- at system.Transactions.Oletx.OletxTransactionManager.ProxyException(COMExcept ion comException) at System.Transactions.Oletx.DtcTransactionManager.Initialize() at System.Transactions.Oletx.DtcTransactionManager.get_ProxyShimFactory() at System.Transactions.Oletx.OletxTransactionManager.CreateTransaction(Transa ctionOptions properties) at System.Transactions.TransactionStatePromoted.EnterState(InternalTransactio n tx) --- End of inner exception stack trace --- at System.Transactions.TransactionStateAborted.CheckForFinishedTransaction(In ternalTransaction tx) at System.Transactions.EnlistableStates.Promote(InternalTransaction tx) at System.Transactions.Transaction.Promote() at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transacti on transaction) at System.Transactions.TransactionInterop.GetDtcTransaction(Transaction trans action) at System.Messaging.MessageQueue.StaleSafeReceiveMessage(UInt32 timeout, Int3 2 action, MQPROPS properties, NativeOverlapped* overlapped, ReceiveCallback rece iveCallback, CursorHandle cursorHandle, IntPtr transaction) at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 actio n, CursorHandle cursor, MessagePropertyFilter filter, MessageQueueTransaction in ternalTransaction, MessageQueueTransactionType transactionType) at System.Messaging.MessageQueue.Receive(TimeSpan timeout, MessageQueueTransa ctionType transactionType) at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.b__12_1() in C:\Bu ildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Transports\Msmq\MsmqDequeueS trategy.cs:line 248 at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.TryReceiveMessage(Func`1 r eceive, Message& message) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus .Core\Transports\Msmq\MsmqDequeueStrategy.cs:line 332


回答1:


For me the issue was that the service Distributed Transaction Coordinator was turned off. After turning it on everything works as expected.



来源:https://stackoverflow.com/questions/40366959/nservicebus-unable-to-receive-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!