All--

So, I swapped out my dev machine and some code that had worked
previously stopped working. I'm generating a
System.Messaging.MessageQueue object using the following code:

public static MessageQueue EstablishRemoteQueue(string ipAddress, string
queueName)
{
        string constructedQueueName = "Formatname:Direct=TCP:" +
ipAddress + "\\private$\\" + queueName;
        // Trace.WriteLine("Remote queue = " + constructedQueueName);
        MessageQueue theQueue = null;
        try 
        {
                theQueue = new MessageQueue(constructedQueueName);
                return theQueue;
        }
        catch(Exception ex)
        {
                UtilitiesAndConstants.ReportExceptionToCommonLog(ex);

                return null;
        }
}

and sending a message some time later like this:

public bool BroadcastMessage(IRemoteMessage theMessage)
{
        // Protect access with a Monitor - if an OrderlyStop arrives
while we are broadcasting,
        // it will cause the MetaDataChannel to try to remove an entry
while we are iterating...
        Monitor.Enter(this);
        try
        {
                foreach(MessageQueue theQueue in this)
                {
                        Trace.WriteLine("Sending multimachine message to
" + theQueue.FormatName);
                        theQueue.Send(theMessage.Serialize().OuterXml);
                }
                return true;
        }
        catch(Exception ex)
        {
                UtilitiesAndConstants.ReportExceptionToCommonLog(ex);
                return false;
        }
        finally 
        { 
                Monitor.Exit(this); 
        }
}

This code worked perfectly for about four months, both in dev and
deployment. Now, with three of our four dev machines having been
replaced, it's stopped working.

As an avenue of exploration, when I set the path for this queue, it
looks like this:
Formatname:Direct=TCP:555.555.28.140\private$\GOURMET_ADMIN

But, when I retrieve them via the .Path or .Name property, I've lost the
"Formatname:" part:
Direct=TCP:555.555.28.140\private$\GOURMET_ADMIN

(IP address altered to protect the innocent.)

Does anyone see what's going on?

--Jekke

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to