3 Replies Latest reply on Dec 2, 2015 2:24 PM by clymbon

    Using JNDI name for ActiveMQ queue in MDB?


      I've set up JBoss AS 7.1.3 to work with a stand-alone ActiveMQ 5.7.0 broker, following the instructions in



      So far, the only way I could get MDBs to work is by using the physical queue name as destination, but I'd like to use the JNDI name to decouple my application from actual queue names in a given deployment. Is there a way to achieve that?


      Here is my queue definition in the resource adapter configuration:



                          <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/exported/jms/queue/jboss-test" use-java-context="true" pool-name="jboss-test">
                              <config-property name="PhysicalName">



      And this is the MDB:




      activationConfig = {

        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),

        @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true"),

        @ActivationConfigProperty(propertyName = "destination", propertyValue = "jboss-test")


      public class JmsQueueConsumer implements MessageListener {





      The sample does not work when setting the destination property to jms/queue/jboss-test. Any ideas...?


      Best regards,