Resolving tmp$ Destinations from a String name
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Curtis_Paris
Posted On:   Monday, January 3, 2005 12:23 PM

What is the method of getting a Queue object out of a destination string (ie, String destinationName = "tmp$12@my.server.test";). My application is sending a destination name as a String inside of an XML datagram. I am able to lookup topics and queue's correctly. But, anything with a $ is thrown out of the system. I can not use the JNDI lookup because tmp$'s are not registered in the JNDI system by SwiftMQ (I suppose I could register it, but, is this the right thing to do?). I can't use the "createQueue" because you can't create a queue with a $ in it. The only way that I have found is to instantiate a com.swiftmq.jms.QueueImpl object. But, trying to be implementatio   More>>

What is the method of getting a Queue object out of a destination string (ie, String destinationName = "tmp$12@my.server.test";).



My application is sending a destination name as a String inside of an XML datagram. I am able to lookup topics and queue's correctly. But, anything with a $ is thrown out of the system.



I can not use the JNDI lookup because tmp$'s are not registered in the JNDI system by SwiftMQ (I suppose I could register it, but, is this the right thing to do?).



I can't use the "createQueue" because you can't create a queue with a $ in it.



The only way that I have found is to instantiate a com.swiftmq.jms.QueueImpl object. But, trying to be implementation agnostic right now, I'm hoping to avoid this.

   <<Less

Re: Resolving tmp$ Destinations from a String name

Posted By:   Andreas_Mueller  
Posted On:   Monday, January 3, 2005 10:54 PM

Any queue with a '$' in its name is a system queue. System queues cannot be directly accessed by JMS clients.


You should not pass the name of a temp. destination inside your message body. The proper way in JMS is to set it as a JMSReplyTo header field. That way you could use msg.getJMSReplyTo() to get the destination and send a message to it.


A temp destination is bound to the connection that creates it. It has a lifetime of the connection. If the connection is closed, the temp. destination is deleted as well. This behavior is mandatory by the JMS spec.


During the lifetime of your connection you can register any temp. destination in JNDI via bind/rebind/unbind. Other JMS clients can lookup anywhere in a router network. All those temp. destinations are automatically unbind from JNDI when the associated connection is being closed. Look here (Section "Bind/Rebind/Unbind").


So again, the proper way in JMS is to set the JMSReplyTo header field in the message.
About | Sitemap | Contact