-
1. Re: Tomcat client,mdb failover issue
timfox Jan 21, 2010 6:41 AM (in response to radhikasivaraj)Please take a look at:
http://community.jboss.org/wiki/Howtoreportabugissue
and
http://community.jboss.org/wiki/CanIusetheSpringJMSTemplatewithHornetQ
You'd need to remove the Spring JMS Template from the equation for us to see what's wrong.
-
2. Re: Tomcat client,mdb failover issue
ataylor Jan 21, 2010 6:44 AM (in response to radhikasivaraj)This is not working because of th eway the spring jms template works.. firstly i would recommend reading the following http://community.jboss.org/wiki/CanIusetheSpringJMSTemplatewithHornetQ.
So in the failover excample the following occurs.
1. client connects to node1
2. node 1 dies
3. client fails over to node 2.
pretty simple. with Spring jms template the following happens
1. client connects to node 1 and sends a message
2. client disconnects.
3. node 1 dies.
4. client tries to reconnect to node 1 ----> this will always fail since the server is not there any more.
-
3. Re: Tomcat client,mdb failover issue
ataylor Jan 21, 2010 6:47 AM (in response to ataylor)regarding part 2 of your question, this is done by configuring the jca adapter and is explained fully in the user manual. -
4. Re: Tomcat client,mdb failover issue
radhikasivaraj Jan 21, 2010 7:43 AM (in response to ataylor)Thanks for your quick response.
Tim, I'll try removing spring template and check.
For mdb, I've gone through the user manual jca sections and thats how I configured my ra.xml. Everything works fine before crash and only on failover to nodeB the MDB fails to connnect to nodeB.
After seeing this post http://community.jboss.org/message/73364#73364 I tried giving DiscoveryAddress and DiscvoveryPort in the config property of ra.xml but I still could not get the MDB to connect to nodeB on failover.
I've attached ra.xml and jms-ds.xml. Pls let me know if there is anything wrong.
-
ra.zip 2.7 KB
-
-
5. Re: Tomcat client,mdb failover issue
ataylor Jan 21, 2010 9:20 AM (in response to radhikasivaraj)you can see from looking at the ra config that it is only connectiong to nodeA , i.e. <config-property-value>host=nodeA;port=5445</config-property-value>.
take a look at the user manual section http://hornetq.sourceforge.net/docs/hornetq-2.0.0.GA/user-manual/en/html_single/index.html#d0e7138 on how to configure it correctly.
-
6. Re: Tomcat client,mdb failover issue
radhikasivaraj Jan 21, 2010 10:07 AM (in response to ataylor)Andy, Thank you so much for pointint it out. MDB failover works fine now.
I just have one more question regarding spring jms listener. Should i not use spring jms listener too similar to spring jms templates because i have the same issue with spring listeners on failover.
Using spring listeners because it supports dynamic selectors which we definitely need, thats why i'm curious to know if there is any work around to make spring listeners work on failover with Hornetq.
-
7. Re: Tomcat client,mdb failover issue
ataylor Jan 21, 2010 10:18 AM (in response to radhikasivaraj)the spring jms listener is also an anti pattern as discussed in the article so i would suggest not using it.
As for spring dynamic selectors, i am not sure what they are. if you explain on more detail what you are trying to do i may be able to help.
-
8. Re: Tomcat client,mdb failover issue
timfox Jan 21, 2010 3:47 PM (in response to radhikasivaraj)The best thing is not to use any of the Spring wrappers around the JMS API.
What's wrong with the JMS API?
-
9. Re: Tomcat client,mdb failover issue
radhikasivaraj Jan 22, 2010 4:00 AM (in response to timfox)Hi, I dont have any issue with JMS api, it is for the asynchronous receive behavior I used spring listener (which also supports dynamic selector(to consume certain messages based on some condition) which MDB doesn't (only supprts static selector).
Also there is an issue when I configure queue nodeB as another live node instead of a backup of nodeA, i.e now there are two queue nodes in cluster nodeA and nodeB.
MDB is deployed in nodeC and not part of cluster which gets connected to nodeA by auto-discovery and picks all messages from nodeA.
When nodeA is killed (i'm not using ctrl-c on the command line), MDB is unable to discover nodeB.
Will auto discovery not work in case if a node failure as i've configured ra.xml to use the Discovery address and port?
Attached ra.xml.
-
ra.zip 2.5 KB
-
-
10. Re: Tomcat client,mdb failover issue
sv_srinivaas Jan 25, 2010 3:59 AM (in response to radhikasivaraj)Hi, I too have the same issue with MDB in Jboss 5.0/ 5.1 GA and Hornetq GA.
When I start a backup node and a live queue node and if the live node crashes then the MDB starts listening to back up node automatically which is good.
But if I just start two live nodes (in cluster) and if one of them crashes (where the MDB is currently listening to) then the MDB does not auto discover the other active node. Pls help.
-
11. Re: Tomcat client,mdb failover issue
timfox Jan 25, 2010 9:42 AM (in response to sv_srinivaas)Like it describes in the user manual (HA chapter), connections fail-over from live nodes to *backup* nodes, not from live nodes to other live nodes.
If you want to failover from live-->live nodes you can add a feature request in JIRA if you like.
-
12. Re: Tomcat client,mdb failover issue
radhikasivaraj Feb 8, 2010 4:40 AM (in response to timfox)Tim,
The MDB failover from live -->live nodes seems to be working, only the reply messages from mdbs are not sent after failure.
Started two nodes node1 and node2 both as live nodes but (by mistake) I configured node2 as a backup node for node1 in ra.xml. Started MDB in node3 which was configured to consume messages from node1.
Everything worked fine and messages were distributed to node1 and node2 in round robin style. When node1 is killed, mdb automatically failed over from node1 to node2 and started consuming messages from node2 though it is not a bakcup server.
Is this the expected behavior?
-
13. Re: Tomcat client,mdb failover issue
clebert.suconic Feb 8, 2010 11:37 AM (in response to radhikasivaraj)I'm not sure what you meant by:
"The MDB failover from live -->live nodes seems to be working, only the reply messages from mdbs are not sent after failure."
Is it working fine or not?
-
14. Re: Tomcat client,mdb failover issue
sv_srinivaas Mar 11, 2010 5:53 AM (in response to clebert.suconic)Hi, I understand from the above posts that MDB cannot failover from one live node to another live node automatically, but is it possible through code to handle this so that the MDB can failover from one queue live node to another?
Say in my case I have a cluster of two queue nodes A and B. I've my MDB in node c and by default it picks messages from node A only.
When nodeA goes down, my MDB goes idle and yes i do understand that Hornetq2.0.0. GA does not support MDB auto failover from one live to another live node, but is there a way that i can handle it in my code so that after 5 attempts it should connect to nodeC and pick messages from there?
Pls help. Thanks!