NServiceBus开始,简单地运行,然后崩溃

时间:2018-02-08 19:32:58

标签: azure nservicebus event-viewer

我在使用NServiceBus的Azure VM上运行Windows服务。当我启动服务时它会启动,运行一分钟左右然后停止。我能找到的唯一错误日志是在事件查看器中。

Application: NServiceBus.Host.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Messaging.MessageQueueException
   at System.Messaging.MessageQueue+MQCacheableInfo.get_WriteHandle()
   at System.Messaging.MessageQueue.StaleSafeSendMessage(MQPROPS, IntPtr)
   at System.Messaging.MessageQueue.SendInternal(System.Object, System.Messaging.MessageQueueTransaction, System.Messaging.MessageQueueTransactionType)
   at NServiceBus.Transports.Msmq.MsmqMessageSender.Send(NServiceBus.TransportMessage, NServiceBus.Unicast.SendOptions)

Exception Info: System.Exception
   at NServiceBus.Transports.Msmq.MsmqMessageSender.ThrowFailedToSendException(NServiceBus.Address, System.Exception)
   at NServiceBus.Transports.Msmq.MsmqMessageSender.Send(NServiceBus.TransportMessage, NServiceBus.Unicast.SendOptions)
   at NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions.SubscriptionManager.SendSubscribeMessageWithRetries(NServiceBus.Address, NServiceBus.TransportMessage, System.String, Int32)
   at NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions.SubscriptionManager+<>c__DisplayClass12_0.<Subscribe>b__0(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

我正在阅读有关此同一问题的较旧帖子,人们说NServiceBus可能正在尝试记录错误,但记录器本身无法导致此问题。有没有人见过这个或有任何见解呢?感谢。

1 个答案:

答案 0 :(得分:1)

在同事的帮助下,我们发现了这个问题。有一个消息队列变量未填充,NServiceBus具有不兼容的消息队列名称格式,导致错误。