Reputation: 29
I have an ActiveMq master slave setup and I want to use failover broker URI in camel route.
Following is my usecase:
Webservice -> CXF -> ActiveMq
When I config the failover URI in spring config file I am getting invalid JMS URI error.
Following are the camel configuration file and soap fault string. Appriciate your help on this.
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 fault Response:
<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>
Upvotes: 1
Views: 1967
Reputation: 107
Try to remove the whitespace in the broker URL string, ergo:
uri="activemq:queue:{{AmqQueue}}?brokerURL=failover:(tcp://{{AmqNode1IP}}:{{AmqPort}},tcp://{{AmqNode1IP}}:61616)?maxReconnectAttempts=3" />
Upvotes: 0