简体   繁体   English

MSMQ读取错误(访问被拒绝)

[英]MSMQ read error (access denied)

I create a queue on my local machine in some other process as follows: 我通过其他一些步骤在本地计算机上创建队列,如下所示:

MessageQueue.Create(@".\private$\sampleQueue");

And in my reader process, I attach to it as follows: 在阅读过程中,我将其附加如下:

var queue = new MessageQueue(@".\private$\sampleQueue");

When I try to do queue.Peek() , I get an access denied exception. 当我尝试执行queue.Peek() ,出现访问被拒绝的异常。 I'm not on a domain, this is just my local workgroup computer. 我不在域中,这只是我的本地工作组计算机。 Any ideas? 有任何想法吗?

MSMQ uses different protocols for it's work: MSMQ使用不同的协议来工作:

  • Pushing information (sending messages) uses MSMQ protocol. 推送信息(发送消息)使用MSMQ协议。
  • Pulling information (receiving messages, getting properties, etc) using RPC protocol. 使用RPC协议提取信息(接收消息,获取属性等)。

If it is not a simple permissions issue (which it is very likely to be) then you need this blog post: 如果这不是一个简单的权限问题(很可能是这样),那么您需要以下博客文章:

Understanding how MSMQ security blocks RPC traffic http://blogs.msdn.com/b/johnbreakwell/archive/2010/03/24/understanding-how-msmq-security-blocks-rpc-traffic.aspx 了解MSMQ安全性如何阻止RPC通信http://blogs.msdn.com/b/johnbreakwell/archive/2010/03/24/understanding-how-msmq-security-blocks-rpc-traffic.aspx

Cheers 干杯
John 约翰

如果在“计算机管理”中的队列上单击鼠标右键,然后选择“属性”,是否在“安全性”选项卡上设置了适当的权限?

The credentials used by the process that creates the queue must be different from the credentials of the process used to read the queue. 创建队列的过程使用的凭据必须与用于读取队列的过程的凭据不同。 If that is the way it must be, then you will need to specifically grant the needed read permissions on the queue after you create it. 如果那是必须的方式,那么在创建队列之后,您将需要专门为其授予所需的读取权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM