5 Replies Latest reply on Mar 6, 2015 6:38 AM by sbrandt

    Message grouping: redistribute groups

    dh2k7

      Hello,

       

      we use message grouping to ensure serial processing of messages of the same group.

      Scenario:

      1. Machine A starts up and starts to produce and consume messages.
      2. After a while (almost) all groups are binded to an consumer an machine A.
      3. Now machine B starts up and joined the cluster.
      4. But because all groups are already established and binded to machine A, machine B gets nearly no messages.

       

      Is there a way to tell the LOCAL grouping handler to redistribute the groups to the newly available consumers on machine B?

       

      Update:

      We are using Hornetq 2.3.1

      If've seen, that in 2.4.0 there is a GroupIdReaper, that removes group bindings after a given timeout. Looks like the feature I'm looking for?

       

      thanks

      Dirk

        • 1. Re: Message grouping: redistribute groups
          jbertram

          Is there a way to tell the LOCAL grouping handler to redistribute the groups to the newly available consumers on machine B?

          Not at this time.  The only way to redistribute a group is to close the consumer who is tagged with the group.

           

          If've seen, that in 2.4.0 there is a GroupIdReaper, that removes group bindings after a given timeout. Looks like the feature I'm looking for?

          I don't think so.  That feature is to remove unused groups after a certain amount of time.  In your use-case the groups are still in use.

          1 of 1 people found this helpful
          • 2. Re: Message grouping: redistribute groups
            dh2k7

            Not at this time.  The only way to redistribute a group is to close the consumer who is tagged with the group.

            So, when using message driven beans (jboss eap), there is no way?

            I don't think so.  That feature is to remove unused groups after a certain amount of time.  In your use-case the groups are still in use.

            As far, as I understand the code, the reaper task is started at fixed rate when the local grouping handler ist started. Everytime the reaper runs, it deletes all group bindings, whose timeCreated is older than a configured age.

            But this creation time is fixed and says nothing about the activity of the group.

            • 3. Re: Message grouping: redistribute groups
              jbertram

              So, when using message driven beans (jboss eap), there is no way?

              Sure there is.  You can restart JBoss EAP or redeploy the MDB.  There may be other admin features in EAP that would allow you to start/stop the MDB (e.g. from the CLI), but I'm not 100% sure on that.

               

              As far, as I understand the code, the reaper task is started at fixed rate when the local grouping handler ist started. Everytime the reaper runs, it deletes all group bindings, whose timeCreated is older than a configured age.

              But this creation time is fixed and says nothing about the activity of the group.

              If you look at the org.hornetq.core.server.group.impl.LocalGroupingHandler.GroupIdReaper class you'll see that it explicitly checks the org.hornetq.core.server.group.impl.GroupBinding#getTimeUsed() and compares it with the group-timeout.

              • 4. Re: Message grouping: redistribute groups
                jbertram

                Couple of things:

                • The HornetQ JCA RA doesn't have functionality equivalent to Camel's "cache level."  Once the ClientSession and ClientConsumer are created they stick around essentially until the MDB is torn down.
                • To be clear, the HornetQ JCA RA doesn't use the JMS API to connect.  It uses the HornetQ Core API.
                • I can't necessarily advocate setting a prefetch size to 1 as I don't know enough about the use-case (e.g. how many messages are actually grouped, the size of the groups, etc.).
                • 5. Re: Message grouping: redistribute groups
                  sbrandt

                  Sorry, I totally got Dirks techstack wrong. I'll delete my answer as it is just confusing.