简体   繁体   中英

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. I'm not on a domain, this is just my local workgroup computer. Any ideas?

MSMQ uses different protocols for it's work:

  • Pushing information (sending messages) uses MSMQ protocol.
  • Pulling information (receiving messages, getting properties, etc) using RPC protocol.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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