Ask a questionAsk a question
 

QuestionUnable to post to Remote Private Message Queue

  • Tuesday, November 03, 2009 11:16 PMmillr Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I'm trying to use MSMQ to post a message to a private queue on a remote machine using C#.  The messages get stuck in the outgoing queue on my machine and never get delivered.  I'm running a website on Windows 7 for development.  I've also tried running a console application on Server 2008 R2.  The remote queue is on a server 2008 R2 machine.  I've given anonymous logon and Everyone users full permissons on the remote queue.  I've tried using TCP and OS format names.  Any Ideas?

    Code to post to queue:

                using (MessageQueue queue = new MessageQueue(queuePath))

                {

                    using (MessageQueueTransaction txn = new MessageQueueTransaction())

                    {

                        using (Message queueMsg = new Message())

                        {

                            txn.Begin();

                            queueMsg.Label = label;

                            queueMsg.Body = msg.ToXml();

                            queue.Send(queueMsg, txn);

                            txn.Commit();

                            result = true;

                        }

                    }

                }

    Queue path:  FormatName:DIRECT=OS:drtran\private$\transcodejobqueue

    I've also tried enumerating the list of private queues on the remote machine (which works) and sending the message via the code below.  I get the same result, the message sits in the outgoing queue on my machine instead of getting delivered.  The state of the queue on my machine is "Waiting to connect"

                foreach (MessageQueue item in MessageQueue.GetPrivateQueuesByMachine("drtran"))

                {

                    string name = item.FormatName;

                    if (item.FormatName.Contains("transcodejobqueue"))

                        item.Send("unittest1", "unittest1", MessageQueueTransactionType.Automatic);

                }

All Replies