On Sat, Apr 4, 2009 at 5:27 AM, ychawla <[email protected]> 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?
When sending a message to a JMS destination you have to consider whether its:
- inOnly (aka fire and forget, eg no JMSReplyTo)
- inOut (aka request/reply, eg with a JMSReplyTo)

As the CXF endpoint is inOut (request/response) then its inherited
while routing in Camel so when you send it to the JMS queue, Camel
expects a reply.
And since it wont get a reply within its default timeout of 20 sec.
you get this exception.

If you want to send a inOnly message to the JMS queue, then you must
use the <inOnly> or set the pattern to inOnly such as:
               <to uri="activemq:TEST.FOO" pattern="inOnly/>
Or
                <inOnly uri="activemq:TEST.FOO"/>


>
> 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());
You have to use a AggregationStrategy to "compute" the response when
you do multicast with request/reply.
Camel will by default just return the last message processed in the multicast.

There should be some aggregationStrategyRef attribute you can set on
the multicast node.



>
> 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
> --
> View this message in context: 
> http://www.nabble.com/Camel-CXF-Component-with-ActiveMQ-tp22879705p22879705.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Apache Camel Reference Card:
http://refcardz.dzone.com/refcardz/enterprise-integration

Reply via email to