I have CXF endpoint. I have dedicated route defined for each operation and routing the request to appropriate routes using header.operation name with reciepient list.
For couple operations(routes), I have post request to JMS endpoint which gets processed by another application and response is recieved in another queue. I have to read response message and transform the message. My requesting thread(webservice call) would be waiting for the transformed message.
Currently after posting request, currently I have written my own processor which use spring jms template to read message. I came across few examples such as split routes but not sure how it will work for overall synchronous communication which has in between JMS communication.
2
votes
1 Answers
3
votes
You can find a JMX Request/Reply example here:
<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
</bean>
<bean id="setResponseProcessor" class="org.apache.camel.itest.jetty.SetResponseProcessor"/>
<camelContext xmlns="http://camel.apache.org/schema/spring" trace="true">
<route>
<from uri="cxf://serverBean"/>
<to uri="jms:responseQueue"/>
</route>
<route>
<from uri="jms:responseQueue"/>
<process ref="setResponseProcessor"/>
</route>
</camelContext>