What happens to MSMQ messages sent when a user does not have permissions to a Queue

msmqpermissions

Doing some testing, it looks like if I try and send a message to a queue that the user is denied the "Send Message" permission on, the message that was sent just disappears. It doesn't show up in the dead letter queue, the outgoing queue, or any other place that I have thought to look. Nor does any sort of exception get thrown when sending the message.

What is happening to that message? Is it really just being eaten or is there something I'm missing?

Here is the code I'm using to send the message:

var q = new MessageQueue(@"[ComputerName]\Test"); 
q.Send("foo"); 

Best Answer

By default, MSMQ will discard ALL messages that cannot be delivered for ANY reason. There will be no error messages unless you are sending to a local machine.

Sending to a remote machine, you only have error messages if you cannot put a message in the outgoing queue which won't help with delivery to the remote queue. Sending to a local machine, there is no outgoing queue mechanism and the local queue manager will try to put the message directly into the required queue so you can have error messages.

You need to enable Negative Source Journaling so that a copy of the message is put in the corresponding Dead Letter Queue so you can find out the reason for non-delivery.

Cheers
John Breakwell