I have been working with HornetQ HA cluster and was trying to create a working solution, but I failed at it. I would appriciate if you would tell me where I am wrong.
I have two JBoss 6.1.EAP (with HornetQ module updated to version 2.3.12) running together in cluster with the following HornetQ configs (which I have attached to this message). I want to get a HornetQ colocated cluster with live+backup pairs on each JBoss, so that messages won't be lost and would be delievered only one time.
I made a test case to see if it was possible. I deployed producer war on the first node (hornetq-producer.zip project) and consumer wars on both nodes (hornetq-mdb.zip project).
My producer sends 5 000 messages to the testQueue on the GET HTTP request. After it has sent all the messages it responds with OK string.
Consumer mdbs has a 300ms delay to consume message, so that the rate of consumption is less than the rate of producing messages.
So the test flow is the following:
- Start producer and wait for it to respond with OK, which means all the messages has been sent.
- After that kill -9 JBoss on node1.
- Wait for all messages to be processed.
- Start node1 again.
- Wait if there are new messages.
- Then count "message received" log entries. Count should be equal to 5 000.
As an example I had this result:
After 3rd step:
node1: 891 messages
node2: 4 367 messages
total: 5 258 messages
After 5th step no messages came.
So the question is if it is possible to achieve what i am trying to get from HornetQ? If so, if the configuration of hornetq servers is right? Or maybe i am missing something important?