I know there are other questions on this, but non actually answer this question.
The Code I have is:
using (var mQ = new MessageQueue(qPath))
{
Console.WriteLine("machine: {0}, name : {1}, path : {2}", mQ.MachineName ,mQ.QueueName, mQ.Path);
Console.WriteLine("message count : {0}",mQ.GetAllMessages().Count());
}
When I try the GetAllMessages() on a local queue, of course everything works:
string qPath = @".\private$\queueName";
However, when I try a queue on a remote machine on the same domain which I can ping successfully with just the computer name, I get this error:
Invalid queue path name. at System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath
I've tried:
string qPath = @"remoteMachineName\private$\queueName";
string qPath = @"remoteMachineName.qualified.net\private$\queueName";
string qPath = @"DIRECT=OS:remoteMachineName.qualified.net\private$\queueName";
string qPath = @"DIRECT=OS:remoteMachineName\private$\queueName";
string qPath = @"DIRECT=OS:ip.ad.re.ss\private$\queueName";
string qPath = @"DIRECT=TCP:ip.ad.re.ss\private$\queueName";
All of those give me the same error.
The documentation on the web states that private queues CAN be found IF you know the full "path".
Is this true? if so, how do compile the full path??
cheers
The exception shows that the path name can't be converted into a format name for some reason. Try creating the queue with a format name
http://msdn.microsoft.com/en-us/library/ch1d814t.aspx
Like, for example, Formatname:DIRECT=OS:ip.ad.re.ss\private$\queueName
Cheers John
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With