You can set up a naming alias like this:
<subsystem xmlns="urn:jboss:domain:naming:1.1"> <bindings> <!-- Following is used for Aliasing JNDI names --> <lookup name="queue_key" lookup="real_queue"/> </bindings> </subsystem>
Or you could just bind the queue to all the relevant JNDI locations, e.g.:
<jms-destinations> <jms-queue name="myQueue"> <entry name="queue_key"/> <entry name="real_queue"/> </jms-queue> </jms-destinations>
Thank you for answering. Which subsystem contains <jms-destinations>. I am NOT using hornet messaging and how will the MDB gets the hint that it has to lookup JNDI.
The messaging subsystem (i.e. <subsystem xmlns="urn:jboss:domain:messaging:1.1">) contains <jms-destinations>. Of course, this subsystem is reserved for HornetQ configuration so you won't be able to use <jms-destinations> if you are not using HornetQ.
Could you clarify a few points?
- If you're not using HornetQ, what are you using?
- How are the MDBs consuming messages from a non-HornetQ destination implementation? Did you change the default <mdb>/<resource-adaptor-ref> in <subsystem xmlns="urn:jboss:domain:ejb3:1.2">?
As far as how the MDB gets the hit that it has to lookup the destination in JNDI, that will depend on the JCA resource adapter which the MDB is using. to be clear, the HornetQ JCA Resource Adapter looks in JNDI by default and then falls back to the HornetQ "core" API to find the destination if JNDI doesn't work.
Here is my configuration:
And this is the Java code to inject the queue into an EJB:
private Queue testQueue;
The ony way I can get this code working on Jboss 7.1 is to add "java:/" to the lookup attribute value! However the same code with a similar configuration works fine on Websphere 8.
Am I missing something here or this is a bug?
Your issue doesn't appear to be related to the main purpose of this thread. Please create a new thread about your issue.