Before posting this question, I searched through all forum threads. I found that my issue is similar to the Sending to authenticated queue However that thread doesn't really answered my question.
I have following setup (using .NET applications and MSMQ)
Note that everything works OK in above setup.
However the issue starts when I enable the "Authenticated" checkbox for the private Queues PQ1 and PQ2 on its General tab. After this settings, the first application sends the MSMQ message to private queue but it ends up in "Transaction dead-letter messages" queue. I tried adding Authenticated Users group to the Queue security tab and giving full access but it did not work.
Further to this I also observed that the Sender tab on Property page of the message that goes to dead-letter queue reads Authenticated: No
Your help is highly appreciated to make the applications work with Authenticated Queue.
After initializing a Message
object, set the
UseAuthentication
property to true
.
Example for sending a message to an authenticated queue:
private void SendToQueue(string queueMessage)
{
var message = new System.Messaging.Message(queueMessage);
message.UseDeadLetterQueue = true;
// This line resolved issue for sending message to queue with Authenticate checkbox checked.
message.UseAuthentication = true;
var queue = new System.Messaging.MessageQueue(@"FormatName:Direct=OS:.\private$\PQ1");
queue.Send(message, MessageQueueTransactionType.Single);
}