JNDI will just give you a reference to a name.
You could replace that by just a call to this method:
For a proper message redistribution you would need to configure load balancing and failover.
I suggest you reading the documentation around those areas.
HI I'm unable to configure HA-JNDI for MDBs.
Environment details: Jboss 5.0.0.GA, Hornet2.0.0.GA, EJB3, Windows XP Sp2.
I have a cluster of two queue nodes A and B. I have an MDB deployed in node C which is not part of the cluster.
By default MDB is configured to consume from node A and hence all the messages were routed to node A (as I had enabled message redistribution in cluster) and everything worked fine as expected.
Then I killed queue node A, after which the messages were sent to nodeB but then the MDB could not pick the messages from nodeB.
Pls let me know how to configure MDBs to use the HA JNDI so that it can pick messages from any of active nodes in the queue cluster. Attached is my ra.xml.
HA-JNDI is a service of JBoss Application Server, not part of HornetQ.
The HornetQ user manual does cover it briefly (see the chapter on JEE integration), but the main documentation on how to configure HA-JNDI is in the JBoss Application Server documentation.
Tim, Yes i understand that its a Jboss AS feature and i also went through the JBoss Application Server documentation for HA-JNDI but i somehow not able to find any info regd how to configure MDBs to use HA JNDI.
As per the Hornetq JCA-Config example I've configured ra.xml for my MDB to consume from nodeA but i'm not sure how to configure it to consume using HA JNDI.
Can you pls let me know which XMLs or point to the right link to know where to specify that the MDB should use HA JNDI? Thanks!
You don't configure HornetQ to use HA-JNDI.
HornetQ knows nothing about HA-JNDI.
HA-JNDI just allows you to lookup JNDI reliably. Like I mentioned before this in an application server service, not a HornetQ service and the docs that tell you how to configure this are in the JBoss AS docs.
Tim, I'm sorry if i'm taking too much of your time, I perfectly understand that this is nothing to do with Hornetq.
I saw an example for ha jndi in the Hornetq distribution for a java client, I thought i can check with you guys to know know if there is a similar example / sample code available for configuring MDBs and ha jndi, may be I should have posted it in a different forum. Also i'm new to EJB/ JCA, so not sure if i use JCA whether i can still use HA JNDI.
I don't understand what you mean by "configuring MDBs and HA-JNDI".
But, in any case, both MDBs and HA-JNDI are not part of HornetQ - they are part of JBoss Application Server.
You'd be better off posting in the EJB or JNDI forum.
OK, sure i've posted in EJB forum.
All i meant by MDB/HA JNDI is, how do i make my MDB to consume messages from any of the available node in my queue cluster. Say initially if it consumes from node 1 and in case if node 1 goes down, MDB should automatically start picking messages from node 2. (node 1 and 2 are in cluster).
I'm sorry if i'm still not clear with my question.
"All i meant by MDB/HA JNDI is, how do i make my MDB to consume messages from any of the available node in my queue cluster" [sic]
As I said, HA-JNDI doesn't have anything to do with clustering. All HA-JNDI gives you is HA of the name, not HA of the queue or the messages.
It's HA-*JNDI*.. nothing beisdes High available names.
If you want clustering and HA messages I suggest you (again) to read the docs about those subjects.