2015-03-03 71 views
1

我有一個ActiveMq主從設置,我想在駱駝路由中使用故障轉移代理URI。在駱駝CXF路由中配置ActiveMq故障轉移代理URL

以下是我用例:

Webservice -> CXF -> ActiveMq 

當我配置了故障轉移URI春天配置文件我越來越無效JMS URI錯誤。

以下是camel配置文件和soap故障字符串。在這方面提供幫助。

CamelConfig:

<?xml version="1.0" encoding="UTF-8"?> 
<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"> 

    <bean id="basicAuthAuthorizationInterceptor" class="org.snaplogic.ws.BasicAuthAuthorizationInterceptor" /> 
    <bean id="responseBean" class="org.snaplogic.ws.ResponseBean" /> 
    <bean id="process" class="org.snaplogic.ws.ResponseProcess" /> 

    <cxf:cxfEndpoint id="runFlow" 
     address="/Report/incident" 
     wsdlURL="etc/WSCentralService.wsdl" serviceClass="org.snaplogic.wscentralservice.WSCentralService" 
     bus="#cxf"> 
     <cxf:inInterceptors> 
      <ref bean="basicAuthAuthorizationInterceptor" /> 
     </cxf:inInterceptors> 
     <cxf:properties> 
      <entry key="dataFormat" value="POJO" /> 
      <entry key="setDefaultBus" value="true" /> 
     </cxf:properties> 
    </cxf:cxfEndpoint> 

    <camelContext id="snaplogic" xmlns="http://camel.apache.org/schema/spring"> 
     <camel:propertyPlaceholder id="properties" 
      location="classpath:incident.properties" /> 
     <route> 
      <from uri="cxf:bean:runFlow" /> 
      <process ref="process" /> 
      <inOnly 
       uri="activemq:queue:{{AmqQueue}}?brokerURL=failover:(tcp://{{AmqNode1IP}}:{{AmqPort}}, tcp://{{AmqNode1IP}}:61616)?maxReconnectAttempts=3" /> 
      <transform> 
       <method bean="responseBean" method="getResponse" /> 
      </transform> 
     </route> 
    </camelContext> 
</beans> 

SOAP錯誤響應:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Body> 
     <soap:Fault> 
     <faultcode>soap:Server</faultcode> 
     <faultstring>Invalid broker URI: failover:(tcp://xxxxxxx:61616, tcp://yyyyyyy:61616)</faultstring> 
     </soap:Fault> 
    </soap:Body> 
</soap:Envelope> 

回答

0

嘗試刪除在代理URL字符串中的空白,ERGO:

uri="activemq:queue:{{AmqQueue}}?brokerURL=failover:(tcp://{{AmqNode1IP}}:{{AmqPort}},tcp://{{AmqNode1IP}}:61616)?maxReconnectAttempts=3" />