Hi,

For you scenario, you just need a async client.
If your client side is also CXF, you can use async client easily, take a look 
at [1] to get more details, the "Asynchronous Invocation Model" chapter

[1]http://cxf.apache.org/docs/developing-a-consumer.html

Freeman
-------------
Freeman Fang

FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-7-18, at 下午1:33, kmohite wrote:

> I have a camel route that's invoked by a web service call. Here I wanted to
> know how I can do the web service call asynchronously.
> Following is the route:
> 
> 1. <camelContext id="device_context"
> xmlns="http://camel.apache.org/schema/spring";>
> 2. <route>
> 3. <from uri="cxf:bean:soapMessageEndpoint?dataFormat=MESSAGE" />
> 4. <process ref="typecastProcessor" id="convertToString" />
> 5. <split strategyRef="aggregatorStrategy">
> 6. <xpath>//deviceList</xpath>
> 7. <unmarshal>
> 8. <jaxb prettyPrint="true"
> contextPath="com.cisco.dlcc.cxf.webservice.model" />
> 9. </unmarshal>
> 10. <process ref="dlcAppProcessor" id="dlcapp" />
> 11. </split>
> 12. <process ref="transformProcessor" id="Transform" />
> 13. 
> 14. <process ref="dlciCallPrepareProcessor" id="dlciPrepare" />
> 15. <to uri="cxf:bean:serviceEndpoint" id="DLCIWebSvcCall"/>
> 16. <process ref="parserProcessor" />
> 17. </route>
> 18. </camelContext>
> 
> Explanation:
> 
> a. At line 3, the input soap xml is received from the web service call made
> by the web service client. The input xml is a list of devices as here:
> <deviceList><var1>?</var1&lt;/deviceList>
> <deviceList><var1>?</var1&lt;/deviceList>
> <deviceList><var1>?</var1&lt;/deviceList>
> 
> b. At line 4, the input xml is converted to string.
> 
> c. At line 5, the the input xml is split on device list and this is fed to
> the processor dlcAppProcessor (line 10). This processer does some processing
> for each device.
> 
> d. At line 12, the processor transformProcessor aggregates the output of all
> the devices and saves it for the next endpoint.
> 
> e. At line 14,15,16 the aggregated information is sent to other system using
> a web service call.
> 
> Here the operations from line 4 onwards (after the input is received) are
> time consuming and hence I do not want the web service client to wait for
> the web service call to return after completing the entire flow. I want the
> the web service call to return immediately after I receive the input xml and
> let remaining processing continue asynchronously.
> I wanted to know how I can achieve this using asynchronous web service call
> ?
> 
> --
> View this message in context: 
> http://servicemix.396122.n5.nabble.com/How-to-do-an-asynshronous-web-service-call-to-a-camel-route-tp5713908.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to