3 Replies Latest reply on Mar 21, 2016 9:48 AM by Craig McIlwee

    High availability and load balancing for MDBs

    Craig McIlwee Newbie

      Hello,

       

      I'm running an application in WildFly that makes pretty heavy use of MDBs.  Clients make HTTP requests to submit tasks and those tasks move from queue to queue to be processed by MDBs.  Most of the documentation related to HA and load balancing seems to be geared toward user sessions and EJBs which aren't something this application needs.  I did find some discussion of each of the topics in the ActiveMQ Artemis documentation but no indication on if and how they can be used in parallel. 

       

      So the first question: Is the combination of HA + load balancing supported?  How would it be achieved?  My guess would be to set up a couple of pairs of live/backup instances and then cluster them together but hopefully someone knowledgeable on this topic can chime in so I don't go down the wrong path.

       

      Then the next question is what the impact on MDBs would be.  In my experience with WildFly 8, live/backup doesn't work because the MDBs in the backup instance fail to deploy since the local broker isn't active.  I'm wondering if this has been addressed in WildFly 10 with the ActiveMQ Artemis switch or if MDBs just can't use HA.

       

      Thanks,

      Craig

        • 1. Re: High availability and load balancing for MDBs
          Justin Bertram Master

          So the first question: Is the combination of HA + load balancing supported?

          Yes.

           

          How would it be achieved?  My guess would be to set up a couple of pairs of live/backup instances and then cluster them together...

          That's correct.

           

          Then the next question is what the impact on MDBs would be.  In my experience with WildFly 8, live/backup doesn't work because the MDBs in the backup instance fail to deploy since the local broker isn't active.

          MDBs consuming from the local broker won't work on a backup since, as you note, the local broker isn't active on a backup.  However, you could configure the MDBs on the backup to consume from the live server and then fail-over to the (local) backup if the live dies.  All that said, it's usually simpler to just host the MDBs in one Wildfly instance and then configure the live/backup pairs in other instances (whether those be Wildfly or just standalone ActiveMQ Artemis).

           

          I'm wondering if this has been addressed in WildFly 10 with the ActiveMQ Artemis switch or if MDBs just can't use HA.

          The aforementioned options have been available since Wildfly first integrated HornetQ.  Nothing specific related to this use-case has changed with Wildfly 10 and Artemis.

           

           

          One final note, it's common to underestimate the messaging load that a single Artemis live/backup pair can handle and assume the clustering is necessary.  You may be able to simplify your use-case with some benchmarking to determine conclusively how many live Artemis instances are necessary to handle your performance requirements.

          • 2. Re: High availability and load balancing for MDBs
            Justin Bertram Master

            I misspoke in my previous comment.  Artemis has actually added some features for this use-case - the ability to easily configure what are called colocated backups.  Using colocated backups a live and backup broker can live in the same JVM.  See the documentation for more details.  Artemis also ships examples demonstrating this (e.g. "ha-policy-autobackup").

            • 3. Re: High availability and load balancing for MDBs
              Craig McIlwee Newbie

              All that said, it's usually simpler to just host the MDBs in one Wildfly instance and then configure the live/backup pairs in other instances (whether those be Wildfly or just standalone ActiveMQ Artemis).

              Thanks for the info.  We have considered this option and think that's the route we'll take.

               

              One final note, it's common to underestimate the messaging load that a single Artemis live/backup pair can handle and assume the clustering is necessary

              Agreed.  I don't expect much trouble on the broker end.  The real load will most likely be the actual message handling and since I am trying to load balance that I figured I'd try to load balance the broker too.  But like I said above, we'll try to load balance the consumers and just go with a live/backup approach for the broker.