camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Camel CXF Component with ActiveMQ
Date Sun, 05 Apr 2009 02:56:33 GMT
Hi,

If you are using Multicast, please keep in mind the default aggregation
strategy is using the latest exchange. So you need put the bean endpoint
 as the last one to endpoint like this.

 		<multicast>
 			<pipeline>
 				<convertBodyTo type="java.lang.String"/>
 				<to uri="activemq:TEST.FOO"/>
 				<to uri="file:C:\temp"/>
 			</pipeline>
          	  	<pipeline>
 				<to
 uri="bean:confirmationResponseBean?method=createConfirmationResponse" />
			</pipeline>

 		</multicast>

BTW, there is a thread[1] which discussed the same issue two weeks ago.

[1]http://www.nabble.com/Camel-2.0---Multicast-issue----td22725597.html#a22738417

Willem


ychawla wrote:
> Hello All,
> I have a question.  I have a Camel route configured to work with the CXF
> component using Camel 1.6.0.  I am trying to invoke a service, send the
> message to a queue and send a response.  However, the message seem to hang
> in the JMS queue.  Here is the route:
> 
> 	<cxf:cxfEndpoint id="dropoffSynchronousWebService-endpoint"
> 		serviceClass="org.wijiscommons.ssaf.drop_off.DropOffSynchronousService"
> 		address="/DropOffSynchronousService"
> 		endpointName="s:DropOffSynchronousService"
> 		serviceName="s:DropOffSynchronousService"
> 		xmlns:s="http://wijiscommons.org/ssaf/drop-off/"
> 
> 	/>
> 
> 
> 	<camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
>     
> 	<route>
> 		<from uri="cxf:bean:dropoffSynchronousWebService-endpoint?dataFormat=POJO"
> />
> 		<to uri="bean:ProcessCXFIntoDOMBean?method=process" />
> 		<to uri="activemq:TEST.FOO"/>
> 		<to uri="bean:confirmationResponseBean?method=createConfirmationResponse"
> />
> 	</route>
> 
> In activeMQ, I see this error:
> 
> Caused by: org.apache.camel.ExchangeTimedOutException: The OUT message was
> not received within: 20000 millis on the exchange: Exchange[JmsMessage:
> ActiveMQTextMessage
> 
> Any ideas?
> 
> I also tried to see up the route in a multicast scenario:
> 
> 		<multicast>
> 			<pipeline> 
> 				<to
> uri="bean:confirmationResponseBean?method=createConfirmationResponse" />
> 			</pipeline>	
> 
> 			<pipeline>
> 				<convertBodyTo type="java.lang.String"/>
> 				<to uri="activemq:TEST.FOO"/>
> 				<to uri="file:C:\temp"/>
> 			</pipeline>
> 		</multicast> 
> 
> Funny thing with the 2nd example is that the message returned to the client
> is the string representation of the input message, rather than the out
> message I explicity set in the confirmationResponseBean like this:
> 
> exchange.getOut().setBody(returnDoc.getDocumentElement());
> 
> If I take activemq out of the equation and have a simple route like this,
> all is fine:
> 	<route>
> 		<from uri="cxf:bean:dropoffSynchronousWebService-endpoint?dataFormat=POJO"
> />
> 		<to uri="bean:ProcessCXFIntoDOMBean?method=process" />
> 		<to uri="bean:confirmationResponseBean?method=createConfirmationResponse"
> />
> 	</route>
> 
> 
> Any ideas?  I have tried all different types of solutions and have had no
> luck.
> 
> Thanks,
> Yogesh


Mime
View raw message