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"); 

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.

John Breakwell


In short... if you don't have permissions to send to that queue... you should get an error message returned from whatever method you used to attempt to send the message. If you're not checking for it, the message just gets tossed in the eternal bit-bucket and is not retrievable. Without more information on what you're using to send messages to the queue... I can't even begin to help you troubleshoot your problem.

  • I'm using the .Net MessageQueue library and a quick test snippet. – Dugan Apr 12 '11 at 16:28
  • actually... I meant what code you're using to send messages to the queue... I already assumed it was the .net framework. – TheCompWiz Apr 12 '11 at 17:27
  • Added to the question – Dugan Apr 12 '11 at 18:47
  • Have you throw the whole mess in a try block and looked at the resulting exception? Also, remember that you must create the queue if it doesn't already exist. UAC can also interfere with accessing the queue. I have an old VB.net snippet I can paste (if you don't laugh too hard at it... it was for a REALLY old project) – TheCompWiz Apr 12 '11 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.