2

几个月后,我终于重新开始使用 nservicebus 并开始在服务器上对其进行测试。不幸的是我得到了这个例外

 The queue does not exist or you do not have sufficient permissions to perform the operation.

我已经使用计算机管理器进行了检查,并且队列确实存在,并且我已授予每个人对队列的完全控制权,但是这个问题仍然存在。我究竟做错了什么?

我在用

  var bus = NServiceBus.Configure.With()
                  .SpringBuilder()
                  .XmlSerializer()
                  .MsmqTransport()
                      .IsTransactional(true)
                      .PurgeOnStartup(false)
                  .UnicastBus()
                      .ImpersonateSender(false)
                      .LoadMessageHandlers()
                  .CreateBus()
              .Start();

 <MsmqTransportConfig
  InputQueue="ListenQueue"
  ErrorQueue="error"
  NumberOfWorkerThreads="1"
  MaxRetries="5"
  />

我在我的开发盒上工作得很好。完整的堆栈跟踪(看起来并不是那么有用)看起来像

System.Messaging.MessageQueueException was unhandled
  Message=The queue does not exist or you do not have sufficient permissions to perform the operation.
  Source=NServiceListener
  ErrorCode=-2147467259
  StackTrace:
       at NServiceListener.Program.Main(String[] args) in C:\temp\NServiceListener\NServiceListener\Program.cs:line 35
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
4

1 回答 1

2

As it turns out I'm an idiot and Udi would have solved this in a second had I posted all the required information. My config file contains

<MsmqTransportConfig
  InputQueue="ListenQueue"
  ErrorQueue="error"
  NumberOfWorkerThreads="1"
  MaxRetries="5"
  />

  <UnicastBusConfig>
    <MessageEndpointMappings>

      <add Messages="EnformMessages" Endpoint="EnformMessages" />
    </MessageEndpointMappings>
  </UnicastBusConfig>

As you can see I'm attempting to listen to messages on a non-existent queue called EnformMessages. Changing that to the InputQueue name or changing the InputQueue name to EnformMessages solved the problem. I am embarrassed by my stupidity

于 2010-02-24T17:34:06.693 回答