I have two CXF endpoints which use JMS as the transport; one is used as a consumer and the second as a producer. Here is a very trimmed down setup.
<camelcxf:cxfEndpoint xmlns:i="http://inbound.com/inbound"
id="myInboundEndpoint"
endpointName="i:InboundService"
serviceName="i:InboundService"
address="camel://direct:my-inbound-route"
serviceClass="com.InboundService"
bus="cxf"
wsdlURL="classpath:META-INF/wsdl/inbound.wsdl">
<camelcxf:properties>
<entry key="dataFormat" value="POJO"/>
</camelcxf:properties>
</camelcxf:cxfEndpoint>
<camelcxf:cxfEndpoint xmlns:o="http://outbound.com/outbound"
id="myOutboundEndpoint"
endpointName="o:OutboundService"
serviceName="o:OutboundService"
address=""jms://""
serviceClass="com.OutboundService"
bus="cxf"
wsdlURL="classpath:META-INF/wsdl/outbound.wsdl">
<camelcxf:properties>
<entry key="dataFormat" value="POJO"/>
</camelcxf:properties>
<camelcxf:features>
<bean class="org.apache.cxf.transport.jms.JMSConfigFeature">
<property name="jmsConfig" ref="jmsConfig" />
</bean>
</camelcxf:features>
</camelcxf:cxfEndpoint>
<bean id="jmsConfig" class="org.apache.cxf.transport.jms.JMSConfiguration">
<property name="connectionFactory" ref="pooledConnectionFactory" />
<property name="targetDestination" value="some-queue" />
</bean>
<camelContext>
<route id="inQueue">
<from uri="activemq:inbound-queue" />
<to uri="direct:my-inbound-route" />
</route>
<route id="inVm">
<from uri="direct:in-vm" />
<to uri="direct:my-inbound-route" />
</route>
<route id="serviceProxy">
<from uri="cxf:bean:myInboundEndpoint?synchronous=true" />
<setHeader headerName="operationName"><constant>myOtherOperation</constant></setHeader>
<to uri="cxf:bean:outboundEndpoint?synchronous=true" />
</route>
</camelContext>
But what happens when the second route is called is that CXF component or camel tries to re-use all the JMS config from the original inbound message including the reply queue rather than creating another temp reply queue just for this exchange. This seems to be taken of the headers from the in message.
If you just use pure JMS and take CXF out of the equation then camel correctly creates a new queue for the inner part of the route although I need to continue to use CXF as there are some legacy interceptors I'm bound to use.
I have tried both using the jms:// + JMSConfig style as well as the camel:// style.
I am currently using the jaxws:client approach and just referencing using bean:myBean?method=myMethod which works but doesn't allow me to propagate SOAP headers from the original inbound method hence switching to use cxf:endpoint instead.
I have tried to find an example of someone using SOAP over JMS using CXF and there seems to be no concrete examples.
So the question is.... is there any additional configuration I need to do for my producer or is there some otherway I can do SOAP over JMS using CXF and propagate/set some headers from the original message/camel exchange?