Ok my issue is similar to How to receive message from a private workgroup queue (and I am basically using the same code).
I am creating the queue on the host machine using
MessageQueue.Create(@".\Private$\MyNewPrivateQueue");
Opening the queue on the remote machine with
var queue = new MessageQueue(@"FormatName:DIRECT=TCP:xxx.xxx.xxx.xxx\PRIVATE$\MyNewPrivateQueue");
And writing/reading data using queue.send() and queue.Receive()
I have two systems that I am experimenting with.
When I create the private queue on the W7 system and try to write then read the queue from the XP system (as per the referenced question) it fails with a "Message Queue Service is not available" exception on the read action.
However, when I reverse the systems (create the queue on the XP system and write/read from the W7 system, and using the same code) it works as expected.
I have worked through:
I have also tried turning off the W7 and XP firewalls, and given every man and his dog full permissions on the queues themselves to no avail.
Given that it works with XP as the queue host but not with W7 as the host I assume that it s a security issue and not a code issue. But for the life of me I cannot see where in W7 the blockage is.
EDIT 8/9
OK .. adding
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters\Security\AllowNonauthenticatedRPC
Allowed me to read messages from the remote private queue. However this does not seem to allow the use of
GetPrivateQueueByMachine(String machineName)
to enumerate the available private queues. So any ideas for this one?
OK .. I obviously didn't read all I needed to read. The answer was in:
MSMQ 4.0 - what's new in Computer Management?
I needed to add a new registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters\Security\AllowNonauthenticatedRPC
and set the value to 1.
Once I did this on the W7 server, then I could read the queue from the XP machine.
Am I the only one who thinks this is weird that anyone could write to the queue, but I had to set this to read from the queue? That is so bizarre.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With