5 Replies Latest reply on Oct 29, 2013 12:06 PM by jbertram

    Hoe to run grouping-handler in Domain cluster mode

    shakirpm4u

      Hi

       

       

      I have jboss-eap-6.1 Cluster where JMS messages are shared across the cluster. This is working fine.

       

       

      Now I want to implement grouping handler so that messages with a particular group_id always go to same node of the cluster.

       

       

      Steps performed :

       

      On master node domain.xml :

       

      <grouping-handler name="my-grouping-handler">

         <type>LOCAL</type>

         <address>jms</address>

         <timeout>5000</timeout>

      </grouping-handler>


      On host1 domain.xml;


      <grouping-handler name="my-grouping-handler">

         <type>REMOTE</type>

         <address>jms</address>

         <timeout>5000</timeout>

      </grouping-handler>

       

       

      In code

       

      message.setStringProperty("JMSXGroupID", "Group-0");

       

       

       

      But what happened is The messages with groupId id are pushed to the same node.

       

      If I execute from node1, It all messages to node1. Then if execute it from node2, It supposed to push all to node1 , Instead it  pushed all to node2.

       

       

       

      Any other configuration changes are required to achieve this is ? Please help

        • 1. Re: Hoe to run grouping-handler in Domain cluster mode
          jbertram

          Now I want to implement grouping handler so that messages with a particular group_id always go to same node of the cluster.

          Message grouping ensures that all message in the same group go to the same consumer, not necessarily to the same node in the cluster.  Take a look at the "clustered-grouping" example in the HornetQ distribution.

          1 of 1 people found this helpful
          • 2. Re: Hoe to run grouping-handler in Domain cluster mode
            shakirpm4u

            Hi Justin,

             

            Thanks for the quick reply....From Grouping example i saw    "Using message groups in a cluster is a bit more complex. This is because messages with a particular group id can arrive on any node so each node needs to know about which group id's are bound to which consumer on which node. The consumer handling messages for a particular group id may be on a different node of the cluster, so each node needs to know this information so it can route the message correctly to the node which has that consumer."

             

             

            So in a cluster it works in two steps

             

            1. The messages will be forwarded to the node where consumer is.

            2.Then the correct consumer will receive it.

             

            So if the first step is happening properly, It should forward to the node where it listen first time right. Then it looks for the consumer.

             

            Please correct me if I am wrong .

             

            Thanks

            • 3. Re: Hoe to run grouping-handler in Domain cluster mode
              jbertram

              Assuming that the consumer hasn't disconnected or anything like that then yes the message will go back to the same node and then to the same consumer.

              • 4. Re: Hoe to run grouping-handler in Domain cluster mode
                shakirpm4u

                Thanks...

                 

                Here an issue. Consider 2 scenarios.

                 

                Every node has single consumer which has the same name. In that case The messages are moved to the cluster node where it is processed initially.

                 

                I mean It looks for the consumer name first in the current queue. If it find, It is processed to the same consumer of that queue instead forward to the node where it was processed before.

                 

                This works fine when there are different named consumers across different queues. I feel like this has to configurable parameters so that user can configure  it.

                 

                 

                Thanks

                • 5. Re: Hoe to run grouping-handler in Domain cluster mode
                  jbertram

                  I don't understand what you mean.  Can you provide a test-case to demonstrate the issue so it will be clear?