3 Replies Latest reply on Oct 18, 2011 8:40 AM by davsclaus

    How to set failover URL in ServiceMix

    dhoyt

      I am running apache-servicemix-4.3.1-fuse-02-05, and am trying to set it up with HA.  I can get the two instances of ActiveMQ to come up in an HA configuration, but how do I set the failover URL so the routes know which server to try first?  Any help is appreciated.

        • 1. Re: How to set failover URL in ServiceMix
          davsclaus

          Hi

           

          Can you be a bit more specific with "routes know which server ..." ?

           

          Do you mean a Camel route where you send a message to a message queue using an ActiveMQ endpoint url?

           

          Generally you configure this in the ActiveMQ component where you refer to the broker urls. In which you can also configure failover options.

          http://camel.apache.org/activemq

          http://activemq.apache.org/failover-transport-reference.html

           

          You can also check details in the ActiveMQ connectivity guide

          http://fusesource.com/docs/broker/5.5/connectivity_guide/index.html

          • 2. Re: How to set failover URL in ServiceMix
            dhoyt

            Hi.  Thanks for the response.  I'll try to be more specific.

             

            I have several OSGI bundles which contain multiple routes similar to the two below (some are in the java DSL).

             

             

             

            I have two instances of ServiceMix 4.3.1-02-05 running on separate servers (server A and server B), and I want to have both ServiceMix servers to use the ActiveMQ from Server A.  If something happens to it, then I want it to failover to the ActiveMQ that is on Server B.  I configured the brokers in a shared-nothing configuration.

             

            Where can I specify the failover url for ServiceMix.  I figured there had to be a config file somewhere which specifies this, but I can't figure out which one it is.

             

            Looking at your first link, it looks like it has to be configured in each bundle.  Is that correct or can I just deploy a single xml file to the deploy directory which defines a new bean (like amq-ha) and just set the brokerURL to the failover URL (and have all my routes use amq-ha instead of activemq)?

            • 3. Re: How to set failover URL in ServiceMix
              davsclaus

              Each bundle should have an  as shown here

              http://camel.apache.org/activemq in the XML file.

               

              This is the Camel JMS client. You can then specify the failover in the brokerURL option.

              I think by default it will use the order in sequence, so specify serverA first, and the serverB as 2nd.