title: Configuring ActiveMq Failover broker URL in Camel CXF routing
body: <p>I have an ActiveMq master slave setup and I want to use failover broker URI in camel route.</p>
  
  <p>Following is my usecase:</p>
  
  <pre><code> Webservice -&gt; CXF -&gt; ActiveMq
  </code></pre>
  
  <p>When I config the failover URI in spring config file I am getting invalid JMS URI error.</p>
  
  <p>Following are the camel configuration file and soap fault string. Appriciate your help on this.</p>
  
  <p><strong>CamelConfig:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring"
      xmlns:cxf="http://camel.apache.org/schema/cxf"
      xsi:schemaLocation="
             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
             http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
             http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd"&gt;
  
      &lt;bean id="basicAuthAuthorizationInterceptor" class="org.snaplogic.ws.BasicAuthAuthorizationInterceptor" /&gt;
      &lt;bean id="responseBean" class="org.snaplogic.ws.ResponseBean" /&gt;
      &lt;bean id="process" class="org.snaplogic.ws.ResponseProcess" /&gt;
  
      &lt;cxf:cxfEndpoint id="runFlow"
          address="/Report/incident"
          wsdlURL="etc/WSCentralService.wsdl" serviceClass="org.snaplogic.wscentralservice.WSCentralService"
          bus="#cxf"&gt;
          &lt;cxf:inInterceptors&gt;
              &lt;ref bean="basicAuthAuthorizationInterceptor" /&gt;
          &lt;/cxf:inInterceptors&gt;
          &lt;cxf:properties&gt;
              &lt;entry key="dataFormat" value="POJO" /&gt;
              &lt;entry key="setDefaultBus" value="true" /&gt;
          &lt;/cxf:properties&gt;
      &lt;/cxf:cxfEndpoint&gt;
  
      &lt;camelContext id="snaplogic" xmlns="http://camel.apache.org/schema/spring"&gt;
          &lt;camel:propertyPlaceholder id="properties"
              location="classpath:incident.properties" /&gt;
          &lt;route&gt;
              &lt;from uri="cxf:bean:runFlow" /&gt;
              &lt;process ref="process" /&gt;
              &lt;inOnly
                  uri="activemq:queue:{{AmqQueue}}?brokerURL=failover:(tcp://{{AmqNode1IP}}:{{AmqPort}}, tcp://{{AmqNode1IP}}:61616)?maxReconnectAttempts=3" /&gt;
              &lt;transform&gt;
                  &lt;method bean="responseBean" method="getResponse" /&gt;
              &lt;/transform&gt;
          &lt;/route&gt;
      &lt;/camelContext&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>Soap fault Response:</strong></p>
  
  <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;soap:Body&gt;
        &lt;soap:Fault&gt;
           &lt;faultcode&gt;soap:Server&lt;/faultcode&gt;
           &lt;faultstring&gt;Invalid broker URI: failover:(tcp://xxxxxxx:61616, tcp://yyyyyyy:61616)&lt;/faultstring&gt;
        &lt;/soap:Fault&gt;
     &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>