Problem with load balancing mdbs in hornetq cluster
sv_srinivaas Jan 6, 2010 2:12 AMHi, I have two issues with MDB and Hornetq cluster. It’ll be of great help if you can spare few mins of your valuable time as I’ve not been able to resolve the following issues.
I have gone through the cluster and mdb related portions of Hornetq user manual but still not able achieve load balancing with mdbs in cluster. Also I’m able to successfully execute the mdb and clustered a queue example that comes with Hornetq.
Version: Hornetq CR2OS:
Windows XP (SP2)
JBoss: 5.0.0. GA
1. First issue is with the load balancing of messages in Hornetq cluster with (EJB3) MDBs where I have only the queue servers clustered and the mdbs deployed in third node which is NOT clustered.
Steps to reproduce the issue
a. Created a cluster of two queue nodes nodeA and nodeB with a queue defined (as sampleQueue).
b. Then I deployed two mdbs MDB1 and MDB2 both in the third node C (which is not part of the above cluster as I had set the clustered param to false for this node in hornetq-configuration.xml) where MDB1 consumes messages from sampleQueue of node A and MDB2 from sampleQueue of node B.
Also I could see that the consumer count for sampleQueue as 15 in both nodeA and B (15 is default pool size for mdb).
c. Then from a client application (hosted in tomcat) I sent 30 messages to sampleQueue in node A
What I could see from jmx console is that all the 30 messages were sent to node A and none was sent to node B and all the 30 messages were consumed by MDB1 (of nodeA) itself.
Is this the expected behavior? I was expecting 15 messages to be consumed by MDB1 from sampleQueue of nodeA and 15 messages to be consumed by MDB2 from sampleQueue of nodeB.
I’ve attached the xmls for all the 3 nodes.
2. Now the second issue is, when I set the clustered param to true in node C (in hornetq-configuration.xml) where the MDBs are hosted (because in PROD the MDBs will also be deployed in a separate cluster) I get the below exception during the nodeC startup.
ERROR [ClusterConnectionImpl] Failed to handle messagejava.lang.IllegalStateException: Cannot find binding for jms.queue.sampleQueue96bf7979-f9f8-11de-bf1c-001a4d1349b0 at org.hornetq.core.server.cluster.impl.ClusterConnectionImpl$MessageFlowRecordImpl.doConsumerCreated(ClusterConnectionImpl.java:758) at org.hornetq.core.server.cluster.impl.ClusterConnectionImpl$MessageFlowRecordImpl.onMessage(ClusterConnectionImpl.java:552) at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:767) at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:45) at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:885) at java.lang.Thread.run(Thread.java:619)
Also I have gone through the below url and made all the necessary changes to avoid any overlapping of Queue and MDB clusters (as they are in the same network). Pls let me know if i'm missing any configuration to run multiple clusters in the same network.
http://community.jboss.org/wiki/TwoClustersontheSameNetwork
-
files.zip 9.0 KB