1
我有.net中的rabbitmq消費者應用程序,它完美地作爲控制檯應用程序運行。但如果我部署作爲一個Windows服務,我收到以下錯誤。RabbitMQ消費者作爲Windows服務
RabbitMQ.Client.Exceptions.OperationInterruptedException: The AMQP operation was interrupted: AMQP close-reason, initiated by Application, code=200, text="Goodbye", classId=0, methodId=0, cause=
at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply()
at RabbitMQ.Client.Impl.ModelBase.BasicConsume(String queue, Boolean noAck, String consumerTag, Boolean noLocal, Boolean exclusive, IDictionary arguments, IBasicConsumer consumer)
at RabbitMQ.Client.Impl.ModelBase.BasicConsume(String queue, Boolean noAck, String consumerTag, IDictionary arguments, IBasicConsumer consumer)
at RabbitMQ.Client.Impl.ModelBase.BasicConsume(String queue, Boolean noAck, String consumerTag, IBasicConsumer consumer)
at RabbitMQ.Client.Impl.ModelBase.BasicConsume(String queue, Boolean noAck, IBasicConsumer consumer)
at RbMQSubscriber.RabbitDataService.Subscribe() in C:\Projects\RabbitMqServices\RbMQClient\RabbitDataService.cs:line 72
at RbMQPublisherService.Service1.backGroundWorker_DoWork(Object sender, DoWorkEventArgs e) in C:\Projects\RabbitMqServices\RbMQSubscriberService\RbMQSubscriberService.cs:line 76
和代碼失敗是
using (_subscription = new Subscription(_channel, _queue, false))
{
foreach (BasicDeliverEventArgs e in _subscription)
{
EventLog.WriteEntry("RBSubService", "in first line", EventLogEntryType.Error);
yield return e;
}
}
如果它部署Windows服務 我使用Windows7的這個代碼僅失敗。任何人面臨類似的問題
你可以發佈你的代碼 –
添加失敗的代碼 – Madhan
@Madhan - 我尋求幫助的Windows服務RabbitMQ。我的控制檯應用程序正在工作,但Windows服務不是。 – TBAG