On Sat, Apr 4, 2009 at 6:21 PM, ychawla <[email protected]> wrote:
>
> Thanks Claus (again),
> Just a few notes here.
>
> I was suspecting it was the MEP.  I kept trying to use syntax like this,
> however it was not working:
> <to uri="activemq:TEST.FOO?exchangePattern=InOnly" />
>
> I did some additional searches on the forums and it seems like users where
> having problems with the syntax above.  However the syntax you suggested
> works great:
>
> <to uri="activemq:TEST.FOO" pattern="InOnly"/>
The first one (=former) (exchangePattern=InOnly) is configuring the
endpoint, that its inonly and that means that when it creates a new
exchange it will set it as inonly.

The latter is changing the MEP of the current exchange, the exchange
in transit. Before this feature you had to do this in a custom
processor.


>
> I found a link to multicast with aggregation strategy in the FUSE
> documentation:
>
> http://fusesource.com/docs/router/1.4/eip/MsgRout-Multicast.html
>
> I know the response is always coming from this endpoint:
> <to uri="bean:confirmationResponseBean?method=createConfirmationResponse" />
>
> I am not quite sure how to set this using the aggregation strategy so I will
> do a little experimenting.  However, for now the pipeline going from the JMS
> queue and then to the response should work out.

In Camel 2.0 we have added the wireTap DSL so you can send to this
wiretap that does all the fire and forget to the AMQ and file
And then afterwards just use a regular to to the bean that also
creates the response.
Then you can avoid the multicast all together.

>
> Thanks for the help!
>
> -Yogesh
>
>
> Claus Ibsen-2 wrote:
>>
>> 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
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Camel-CXF-Component-with-ActiveMQ-tp22879705p22885124.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