I've got a Spring application which needs to look up a JMS destination in order to do it's work. Depending on whether we are in a development or system testing environment we will be using different JMS implementations. (Oracle AQ in system test with WebLogic, Apache ActiveMQ deployed in Jetty for Dev)
I have configured ActiveMQ and deployed it fine and it creates it's destinations in the activemq.xml file:
<destinations>
<queue physicalName="handlersDest" />
<topic physicalName="notificationsDest" />
</destinations>
When I start my handler (Spring) application it does a lookup for the destinations:
<jee:jndi-lookup id="handlersDest" jndi-name="$handlersDest">
<jee:environment>
java.naming.factory.initial = ${jndi.jms.naming.factory.initial}
java.naming.provider.url = ${jndi.jms.naming.url}
queue.handlersDest = handlersDest
</jee:environment>
</jee:jndi-lookup>
My problem is that I have to add the following line to the environment for it to work:
queue.handlersDest = handlersDest
I know this is telling ActiveMQ's initial context that there is a destination called "handlersDest" and that it should ensure it is registered under the queue name "handlersDest" but I don't know why I need to do this in the client application?
Can't I predefine these JNDI names in the activemq.xml or somewhere else in my application which deployes activemq?