I am trying to get my head around how multicasting works in MSMQ but I cannot receive messages at all, even from the same machine. I'm obviously doing something wrong but cannot see what.
Here's where I'm at:
I manually created a non-transactional private queue called MulticastTest
and then set the Multicast address to 234.1.1.1:8001
. Then my test sending app does this:
MessageQueue queue = new MessageQueue("FormatName:MULTICAST=234.1.1.1:8001");
queue.Send("Hello World");
This works, it at least seems to send the message which I see in an outgoing queue on the same machine. At least I assume this is correct, please tell me if it isn't.
So now I try and run my receiving app (either on the same machine or a different one configured to the same multicast address) and I cannot get it to work. If I try this:
MessageQueue queue = new MessageQueue("FormatName:MULTICAST=234.1.1.1:8001");
var message = queue.Receive();
It simply won't work, the Receive()
method throws an exception saying:
The specified format name does not support the requested operation. For example, a direct queue format name cannot be deleted
If I try and set the receiving queue as .\private$\MulticastTest
it at least waits for a message but nothing happens, all messages still stay in the outgoing queue.
So what am I doing wrong? Does some kind of service need to be running for MSMQ to send out messages from the outgoing queue?
I have also tried giving full permissions to the ANONYMOUS USER as per this question but that has no affect.