在Camel CXF路由中配置ActiveMq故障转移代理URL

时间:2015-03-03 06:35:58

标签: java spring cxf apache-camel activemq

我有一个ActiveMq主从设置,我想在驼峰路由中使用故障转移代理URI。

以下是我的用例:

 Webservice -> CXF -> ActiveMq

当我在spring配置文件中配置故障转移URI时,我收到了无效的JMS URI错误。

以下是camel配置文件和soap fault字符串。请大家帮忙。

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: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 个答案:

没有答案
相关问题