Connecting To A Private Remote MSMQ Queue
Asked Answered
J

4

6

I'm trying to connect to a remote private MSMQ queue using the path:

"FormatName:DIRECT=OS:remoteMachineName\Private$\MyQueue"

and I'm getting the following error:

"The specified format name does not support the requested operation. For example, a direct queue format name cannot be deleted."

I'm obviously doing something wrong. However this does work using a local queue.

I'm using Spring.Net's Messaging. Here's my config

<objects xmlns="http://www.springframework.net">
  <object id="myQueue" type="Spring.Messaging.Support.MessageQueueFactoryObject, Spring.Messaging">
    <property name="Path" value="FormatName:DIRECT=OS:remoteMachineName\Private$\MyQueue"/>
  </object>

  <object id="messageQueueTemplate" type="Spring.Messaging.Core.MessageQueueTemplate, Spring.Messaging">
    <property name="DefaultMessageQueueObjectName" value="myQueue"/>
  </object>

  <object id="messageGateway" type="My.MessageGateway, My.Assembly">
    <property name="MessageQueueTemplate" ref="messageQueueTemplate"/>
  </object>
</objects>
Jellaba answered 17/12, 2008 at 22:5 Comment(1)
Are you operating within an Active Directory domain, or are the servers standalone?Closing
A
5

Is this a transactional queue? Remote read from transactional queue is not possible. Maybe the spring framework try to check if this a transactional queue, and this is also an operation that is supported only on local queue.

The recommanded why to work with queues is to write to remote queue and read from local queue. In msmq 4.0 ( vista and windows 2008 ) remote transactional read is supported ( so I have heard).

Can you debbug the spring.net code and see the exact code when the process fail?

Ashti answered 17/12, 2008 at 22:22 Comment(0)
P
-1

the first thing striking my eyes is the casing of your endpoint address. At least all other examples posted in this thread or here use different casing. Second you are not escaping the backslashes within the string. Instead of

"FormatName:DIRECT=OS:remoteMachineName\Private$\MyQueue"

try

"FormatName:Direct=OS:remoteMachineName\\private$\\MyQueue"

hth, Erich

Phosphorate answered 5/1, 2009 at 9:13 Comment(1)
Escaping backslashes is a C# encoding thing. This does not apply in XML config files. Also, the infosysblogs.com link from Ken explains that case sensitivity only applies to "FormatName" and not "Direct".Adventitia
Y
-1

The Microsoft Help documents state that private queues are only "available" from the local computer:

Public queues are replicated throughout the Message Queuing network and can potentially be accessed by all of the sites connected by the network.

Private queues are not published across the entire network. Instead they are available only on the local computer that contains them. Private queues can be accessed only by applications that know the full path name or label of the queue.

(from: http://msdn.microsoft.com/en-us/library/19ww660c(VS.71).aspx).

This is all a bit ambiguous really!

Another post on Stack Overflow references this article:

http://technet.microsoft.com/ja-jp/library/cc753440(WS.10).aspx

Which has a much more useful description of Public vs Private queues.

Yarmouth answered 28/10, 2010 at 9:52 Comment(1)
The initial point is a bit misleading. Private queues ARE available remotely, they're simply not published to an Active Directory. To access a remote private queue, as you say, you need to know the full path name or label of the queue.Scientific
C
-1

Your Trying is correct,but you have to define two other properties for your object indicating your queue is remote or not and is transactional or not:

<object id="myQueue" 
        type="Spring.Messaging.Support.MessageQueueFactoryObject,Spring.Messaging">      
  <property name="Path" value="FormatName:DIRECT=OS:remoteMachineName\Private$\MyQueue"/>
  <property name="RemoteQueue" value="true"/>
  <property name="RemoteQueueIsTransactional" value="true"/>
</object>
Canso answered 1/5, 2012 at 5:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.