Dg,

You are doing all these on a local machine. Accessing, let alone creating, a
private queue on a remote machine is a whole new story. It boils down to
user privileges, what is (s)he allowed and not allowed to do.
I believe the problem is that the messages are not delivered.

Jekke, have you tried to ask confirmation for the delivery? You should get a
real reason for the message being dropped.

Regards,
Eddie


-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] Behalf Of David Glauser
Sent: Thursday, August 24, 2006 4:19 PM
To: [email protected]
Subject: Re: [ADVANCED-DOTNET] MSMQ woes


I construct a queue name without the FormatName, like
            string queueName = string.Format(".\\Private$\\xpLog{0}",
institutionId);

Pass that to MessageQueue.Create and it seems to work fine in all
circumstances. The debugger shows the queue with
FormatName      "PRIVATE=8169ec75-411a-407a-b4dc-3acade1fe0c1\\00000017"
string
QueueName       "Private$\\xpLog3087"   string

Dg

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Jekke Bladt
Sent: Thursday, August 24, 2006 1:01 PM
To: [email protected]
Subject: [ADVANCED-DOTNET] MSMQ woes

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(r)  http://www.develop.com

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

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

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

===================================
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