You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Michele <mi...@finconsgroup.com> on 2015/11/20 18:47:48 UTC

How to invoking external rest service in camel route

Hi everyone,

I need to invoke an external rest service and this is my scenario:

1. From active mq retrieve message
2. Invoke external rest service and process response
3. On success message is moved to another endpoint.

Using httpapi I obtain a response, but I would like to use httpproxyapi but
I don't understand how to configure it.

I tried this but doesn't work:

<cxf:rsClient id="rsClient" address="${rs.context path}"
 serviceClass="com.test.FooService"></cxf:rsClient>
<camelContext>
   <route>
        <from uri="activeness:queue:incoming">
        <inOut uri="cxfrs:bean:rsClient?httpClientAPI=false">
       <process ref="ResponseProcessor" />
     .....
     
</camelContext> 
Where FooService is an interface.

It seems that interface is not considered. 

Where can I found a complete example related to my scenario?

Thanks in advance.

Kind regards.

Michele




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-invoking-external-rest-service-in-camel-route-tp5774158.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to invoking external rest service in camel route

Posted by Michele <mi...@finconsgroup.com>.
Hi Claus,

thank you for your answer. 

Exactly, i would like to use CXF because i work with complex pojo to send to
External Rest Service, but I don't found a complete example to help me.

Can Restlet do it? 

With HttpApi i need to build up the request body myself and i don't like as
approach.
(as reported in this post:
http://camel.465427.n5.nabble.com/CXFRS-Producer-td5722162.html)

Thanks for your help.

Kind Greeting

Michele





--
View this message in context: http://camel.465427.n5.nabble.com/How-to-invoking-external-rest-service-in-camel-route-tp5774158p5774183.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to invoking external rest service in camel route

Posted by Claus Ibsen <cl...@gmail.com>.
To call a remote REST service then CXF can often be overkill.
Sometimes its easier to use plain http or restlet components.

Though it depends, CXF allows to use bean/pojo's and bindings that
makes sense to use if your message body is already a POJO.



On Fri, Nov 20, 2015 at 6:47 PM, Michele
<mi...@finconsgroup.com> wrote:
> Hi everyone,
>
> I need to invoke an external rest service and this is my scenario:
>
> 1. From active mq retrieve message
> 2. Invoke external rest service and process response
> 3. On success message is moved to another endpoint.
>
> Using httpapi I obtain a response, but I would like to use httpproxyapi but
> I don't understand how to configure it.
>
> I tried this but doesn't work:
>
> <cxf:rsClient id="rsClient" address="${rs.context path}"
>  serviceClass="com.test.FooService"></cxf:rsClient>
> <camelContext>
>    <route>
>         <from uri="activeness:queue:incoming">
>         <inOut uri="cxfrs:bean:rsClient?httpClientAPI=false">
>        <process ref="ResponseProcessor" />
>      .....
>
> </camelContext>
> Where FooService is an interface.
>
> It seems that interface is not considered.
>
> Where can I found a complete example related to my scenario?
>
> Thanks in advance.
>
> Kind regards.
>
> Michele
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-invoking-external-rest-service-in-camel-route-tp5774158.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2