使用 asp.net Web 服务的 NServiceBus 中的 MSMQ 访问问题

发布于 2024-08-14 04:13:19 字数 1674 浏览 3 评论 0原文

我正在尝试在我的 asp.net (wcf) Web 服务项目中实现发布者-订阅。当我尝试在 global.asax 中创建总线

 protected void Application_Start(object sender, EventArgs e)
    {
        try
        {
            log4net.Config.XmlConfigurator.Configure();                
            Bus = NServiceBus.Configure.WithWeb()
          .SpringBuilder()
          .BinarySerializer()
          .MsmqTransport()              
              .IsTransactional(false)
              .PurgeOnStartup(false)
          .UnicastBus()
              .ImpersonateSender(false)
          .CreateBus()
          .Start();                
        }
        catch (Exception ex)
        {
            log.Error(ex);
        }
    }
  public static IBus Bus { get; private set; }

但它没有创建总线时..然​​后它抛出异常

    Exception reached top level.
System.Messaging.MessageQueueException: Access to Message Queuing system is denied.
   at System.Messaging.MessageQueue.MQCacheableInfo.get_ReadHandle()
   at System.Messaging.MessageQueue.StaleSafeReceiveMessage(UInt32 timeout, Int32 action, MQPROPS properties, NativeOverlapped* overlapped, ReceiveCallback receiveCallback, CursorHandle cursorHandle, IntPtr transaction)
   at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 action, CursorHandle cursor, MessagePropertyFilter filter, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
   at System.Messaging.MessageQueue.Peek(TimeSpan timeout)
   at NServiceBus.Unicast.Transport.Msmq.MsmqTransport.Receive()
   at NServiceBus.Utils.WorkerThread.Loop()

我怎样才能避免这种情况?.... ....我在中间感到震惊...


nRk

I am trying to implement publisher - subscribe in my project of asp.net (wcf) web services. When i am trying to create bus in global.asax

 protected void Application_Start(object sender, EventArgs e)
    {
        try
        {
            log4net.Config.XmlConfigurator.Configure();                
            Bus = NServiceBus.Configure.WithWeb()
          .SpringBuilder()
          .BinarySerializer()
          .MsmqTransport()              
              .IsTransactional(false)
              .PurgeOnStartup(false)
          .UnicastBus()
              .ImpersonateSender(false)
          .CreateBus()
          .Start();                
        }
        catch (Exception ex)
        {
            log.Error(ex);
        }
    }
  public static IBus Bus { get; private set; }

but it is not creating bus.. then it is throwing exception

    Exception reached top level.
System.Messaging.MessageQueueException: Access to Message Queuing system is denied.
   at System.Messaging.MessageQueue.MQCacheableInfo.get_ReadHandle()
   at System.Messaging.MessageQueue.StaleSafeReceiveMessage(UInt32 timeout, Int32 action, MQPROPS properties, NativeOverlapped* overlapped, ReceiveCallback receiveCallback, CursorHandle cursorHandle, IntPtr transaction)
   at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 action, CursorHandle cursor, MessagePropertyFilter filter, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
   at System.Messaging.MessageQueue.Peek(TimeSpan timeout)
   at NServiceBus.Unicast.Transport.Msmq.MsmqTransport.Receive()
   at NServiceBus.Utils.WorkerThread.Loop()

How Can I Avoid this?.... .... I am struck in the middle...

nRk

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

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

发布评论

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

评论(1

风月客 2024-08-21 04:13:20

这很可能是一个安全问题,请确保授予每个人对所涉及队列的完整权限,

希望这会有所帮助!

This is most likely a security issue, make sure to give everyone full rights to the queues involved

hope this helps!

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