3 Replies Latest reply on Mar 21, 2005 4:21 PM by lekkim

    Deferred use of JMSReplyTo / Destination.toString()

    lekkim

      I have a scenario where I need to store the JMSReplyTo from a JMS message for later use. When I look at the Message.getJMSReplyTo() the returned Destination (Queue/Topic) has two methods I could use:
      - toString (example value: QUEUE.lekkim/nitram/bocaj)
      - getQueueName (example value: lekkim/nitram/bocaj)

      I know I could just compose the queue name by prepending "queue/" to the value returned by the getQueueName() method but I don't know if it is "standard".

      Could some installations of JBoss choose to change the "queue/" prefix in JNDI or is it given per J2EE that queues are located under this prefix ?

      Thank you for any replies.

        • 1. Re: Deferred use of JMSReplyTo / Destination.toString()
          amit.bhayani

          JMS specification does not say anything about naming policy. So the 'queue' prefix is specific to JBoss. Chances of JBoss future relase changing this is very dim, unless JMS Specification changes drastically :)

          Amit.

          • 2. Re: Deferred use of JMSReplyTo / Destination.toString()

            If you cannot maintain the javax.jms.Destination object
            you can do session.createQueue(...) from Queue.getQueueName()
            provided you are talking to the same jms server.

            • 3. Re: Deferred use of JMSReplyTo / Destination.toString()
              lekkim

               

              "adrian@jboss.org" wrote:
              If you cannot maintain the javax.jms.Destination object
              you can do session.createQueue(...) from Queue.getQueueName()
              provided you are talking to the same jms server.

              Yeah I figured as much since the interface doesn't extend java.io.Serializable... The question went more as to whether I could reconstruct the queue name at a later time using "queue/" + msg.getJMSReplyTo().getQueueName() and make sure it worked (per J2EE spec.) or whether the "queue/" prefix had to be a configurable parameter.

              Thank you for your response and clarification though.