-
1. Re: MDB in Jboss AS 7- Queue/Topic Mapping
jbertram May 20, 2012 3:28 PM (in response to wichkabashir)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>
-
2. Re: MDB in Jboss AS 7- Queue/Topic Mapping
wichkabashir May 20, 2012 7:38 PM (in response to jbertram)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.
Thanks,
Bashir
-
3. Re: MDB in Jboss AS 7- Queue/Topic Mapping
jbertram May 20, 2012 9:38 PM (in response to wichkabashir)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.
-
4. Re: MDB in Jboss AS 7- Queue/Topic Mapping
mohammadwrk Jun 29, 2012 2:32 PM (in response to jbertram)Here is my configuration:
<jms-destinations>
<jms-queue name="testQueue">
<entry name="jms/queue/test"/>
</jms-queue>
</jms-destinations>
And this is the Java code to inject the queue into an EJB:
@Resource(lookup="jms/queue/test")
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?
-
5. Re: MDB in Jboss AS 7- Queue/Topic Mapping
jbertram Jul 5, 2012 11:01 AM (in response to mohammadwrk)Your issue doesn't appear to be related to the main purpose of this thread. Please create a new thread about your issue.