2 Replies Latest reply: Apr 16, 2012 10:44 PM by java into RSS

Understanding HornetQ Cluster and Bridge working

java into Newbie

Hi ,

I need some help in understanding how Clustering works in HornetQ and clarify few doubts i have. I have a setup which is shown below. I am able to setup a cluster and clustering seems to be working with duplicate detection but nowhere i was able to get documentation on how it works. So here are my questions if you can help.

 

hornetqclustered.JPG

The Events E1,E2,E3...En ate coming at T1,T2..Tn and are getting load balanced between the Machine 1 and Machine 2 both of which are Jboss servers with a queue 1 which is clustered.

 

Q 1. Now when on Machine 1 - queue1 receive E1,E3,E4,E6 message is it copied over and send over network using the bridge connection internally to Machine 2. In this way if Machine 1 goes down then Machine 2 will be have a complete Copy of messages in clustered queue1 and when machine 1 comes up can sync it over the network to it.

 

Q2. If on Machine 2 if a Consumer consumes a message say E2 then is there a internal message which will be send to Machine 1 to remove E2 from its queue1. IN Short does consumption of message lead to messaging to other nodes in cluster to delete the E2's from its queue.

 

Q3. Since E2 happened after E1 and lets say i am consuming only on one of the machines (Machine 2) then the consumer will receive the ordered list of events as they were inserted in queue (i.e E1,E2,E3,E4,E5,E6...)

 

Q3. If my unserstanding of how queue works is not correct internally correct ....can some one please explain it to me. Feel free to use my diagram.

  • 1. Re: Understanding HornetQ Cluster and Bridge working
    Justin Bertram Master

    Q 1. Now when on Machine 1 - queue1 receive E1,E3,E4,E6 message is it copied over and send over network using the bridge connection internally to Machine 2. In this way if Machine 1 goes down then Machine 2 will be have a complete Copy of messages in clustered queue1 and when machine 1 comes up can sync it over the network to it.

    Messages are not replicated between cluster nodes.  If one node in a cluster goes down then the persistent messages on that node will be unavailable until that node comes alive again unless that node has a backup.  The live/backup configuration where 2 nodes share the same journal is the only configuration which supports the high availability of messages.  The live/backup configuration is active/passive.  You can read more about high-availability and fail-over in the documentation.

    Q2. If on Machine 2 if a Consumer consumes a message say E2 then is there a internal message which will be send to Machine 1 to remove E2 from its queue1. IN Short does consumption of message lead to messaging to other nodes in cluster to delete the E2's from its queue.

    Since messages are not replicated between cluster nodes this isn't necessary.

     

    Please note that message replication will be supported in the future.

  • 2. Re: Understanding HornetQ Cluster and Bridge working
    java into Newbie

    Hi Justin,

     

    The reason for my understanding of why message are replicated is this.

    Messages are not replicated between cluster nodes.

     

    While Putting any message in queue1 i am using this property

     

       

    clientM.putStringProperty(ClientMessage.HDR_DUPLICATE_DETECTION_ID, uid);

     

    As a result of this what i am achieveing is lets say in the above diagram If E1 event happens Again and is routed to Machine 2 (rather than Machine 1 as in case of first E1) by load balancer then the Message doesnt get in to the queue1 of Machine 2. This is the duplicate detection which drops the message.

    How does machine 2 know to drop E1 if E1 is not duplicated. 

     

    In Short I have seen Duplicate detection work on a Clustered queue1. So how will it work if the messages are not duplicated.

     

     

     

    Q2. If what you say is correct and there is no duplication ...How can i achieve a consumer which will be able to get the correct order of elements out of queue (E1(from M1)...E2(from M2).....E3(from M3)...etc)