1 Reply Latest reply on Feb 11, 2010 9:36 PM by Yong Hao Gao

    How can I use duplicate JNDI names for Queues?

    Kevin Halk Newbie

      Hi there,

      This may seem like a stupid question but is there any way to specify duplicate JNDI names for Queues?

       

      We require several separate EJBs to reference the same queue (A outputs to Q1, B reads Q1 etc..). I'd like to be able to have any number of these available at any time (i.e. both A and B might not necessarily be there). 

       

      This means that either one could be responsible for creating Q1.

       

      I can specify the Queue to be created in A and B's deployment descriptors, however I get an error saying the JNDI name already exists when it tries to create the second time (obviously).  I would like the Queue to be created if it does not already exist - is there any way to accomplish this without an error?

        • 1. Re: How can I use duplicate JNDI names for Queues?
          Yong Hao Gao Master

          I'm afraid you can't achieve it with JBM. JBM will throw exception is a destination with same jndi name already been deployed. However, EJB descriptor is not part of JBM. You may ask EJB experts to see if there is a way to work around this.

           

          If the Queue is always needed no matter which EJB is working, why not deploy it as a separate service?

           

          btw, please put the user questions to the JBoss Messaging user forum in the future. This forum is about development discussions. Thanks.