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: Cxf-rs endpoint implementation
Date Fri, 28 Jan 2011 09:23:17 GMT
On 1/28/11 4:17 PM, ghosh wrote:
>
> I could have noticed  that.. ..Thanks for the help.
>
> Please help me understand below points
>
> 1. why do we need two different bean with same config.. given below...
>
The camel route just work as a Proxy, it redirect the request to the 
real CXF RS server and send the response back.

> <!-- Defined the server endpoint to create the cxf-rs consumer -->
>    <cxf:rsServer id="rsServer" address="http://localhost:9000/route"
>
> serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"
> />
This is for the cxf-rs consumer.
>
>    <!-- Defined the client endpoint to create the cxf-rs consumer -->
>    <cxf:rsClient id="rsClient" address="http://localhost:9002/rest"
>
> serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"/>
>
This is for the cxf-rs producer.

> 2. And why do I need to mention both rsServer and rsClient in my route ?
>
We just route the message from rsServer to rsClient, and rsClient will 
send the request to the real CXF RS server and send the response back 
the the rsServer.

> I understand that in camel ,consumer is a server (from camel in action)...
> but still not
> able grasp the right picture here... meanwhile I tried to get below route
>
> <from uri="direct:start" />
> <to uri="bean://requestTask" />
> <to uri="cxfrs://bean://rsServer" />
> 	<setHeader headerName="CamelCxfRsUsingHttpAPI">
> 		<constant>True</constant>
> 	</setHeader>
> <to uri="cxfrs://bean://rsClient" />
> <to uri="bean://responseTask" />
>
> Idea was to use a rest service in my processing route invoking it from
> requestTask and getting the response in response task.
>
If you want to set the response back by using the bean://responseTask, 
you don't need to send the message to cxfrs://bean://rsClient.
>
> Ghosh


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Mime
View raw message