1 Reply Latest reply on Aug 2, 2005 4:21 AM by Joerg Thoennes

    Queue location in JNDI tree

    Tim Lam Newbie

      Curious question can a queue be created and placed in branch other than "queue" or in a sub branch of "queue"? For example if I had a destination named TestQueue, could the queue be created under customqueue/TestQueue or queue/jms/TestQueue?

      Thanks.

        • 1. Re: Queue location in JNDI tree
          Joerg Thoennes Newbie

          What you call "branch" is the JNDI name of the queue. If you deploy a queue using the org.jboss.mq.server.jmx.Queue MBean, the JNDI name of the queue is derived from the MBean "name" attribute, ie

          <server>
           <mbean code="org.jboss.mq.server.jmx.Queue"
          name="jboss.mq.destination:service=Queue,name=customqueue/TestQueue">
           <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
           </mbean>
          </server>
          


          will bind the queue at "customqueue/TestQueue".

          If you want very special JNDI names (ie if they contain ":" which is not allowed inside the MBean name), use the optional attribute

          <attribute name="JNDIName">customqueue/TestQueue:1</attribute>
          


          Actually, you can bind the queue even to several names in JNDI: just lookup() the queue using a JNDI name and bind() the result to another one.

          The "queue/" location is just default location, I am not aware of further consequences if you do not use it.

          Cheers, Jörg