在 nservicebus 中创建队列时出错

发布于 2024-08-22 16:32:56 字数 1790 浏览 2 评论 0原文

几个月后,我终于重新开始使用 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()

After some months I am finally back to using nservicebus and started to test it out on a server. Unfortunately I am getting this exception

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

I've checked using computer manager and the queue does exist and I have granted everybody full control over the queue however this problem persists. What am I doing wrong?

I am using

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

and

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

I works just fine on my dev box. The full stack trace (which doesn't seem all that useful) looks like

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()

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心作怪 2024-08-29 16:32:56

事实证明我是个白痴,如果我发布了所有必需的信息,Udi 就会立即解决这个问题。我的配置文件包含

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

  <UnicastBusConfig>
    <MessageEndpointMappings>

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

如您所见,我正在尝试侦听名为 EnformMessages 的不存在队列上的消息。将其更改为 InputQueue 名称或将 InputQueue 名称更改为 EnformMessages 解决了该问题。我为自己的愚蠢感到羞耻

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文