camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bilgin Ibryam <bibr...@gmail.com>
Subject Re: support for RESTful endpoint or dynamic endpoint construction
Date Thu, 29 Mar 2012 23:38:34 GMT
Hi Zemin,

inline

On 29 March 2012 18:25, Zemin Hu <zemin_hu@hotmail.com> wrote:

> Hi,
> I am new here, I posted this to developer forum which seems not good place
> for this, so I am re-posting it here.
>
> I have couple of RESTful web service that I want to use Camel as
> integration
> point. I had a brief review for restlet which is supposed to be the
> solution, but from I have seen, it's not straight forward to use:
> 1. straight forward support/construct RESTful dynamic URL for both  and :
> http://host:port/services/{uid}/table1/{item_id}
>

On http://camel.apache.org/restlet.html there are example on how to define
dynamic urls like

atom/collection/{id}/component/{cid}

also have you seen the restletUriPatterns option, which allows you to
define urls externaly from the endpoint url

2. it supports request methods GET,POST,PUT, DELETE, I did not see how Camel
> handles these methods.
>
>

Sometime ago I created a simple restlet example where you can see how to
restlet with GET,PUT,DELETE,POST methods

http://www.ofbizian.com/2012/02/apache-camel-rest-example.html


HTH
Bilgin



> Can Camel handle dynamic URL construction with variables? in ideal case, it
> should support:
>
>
>
> Since many social network APIs are in this format, for instance:
> http://graph.facebook.com/{uid}/picture
> http://graph.facebook.com/{uid}/friends
> http://graph.facebook.com/{uid}/{about_everything}
>
> Can Camel at least support dynamic construction of URL out of box even
> without PUT and DELETE support?
> I don't know how big effort is needed to do this. If required, I am willing
> to contribute.
>
> I looked at the this CXFRS component for Rest endpoint, it seems to me no
> use to me. If I am writing Spring controllers like the sample code:
> @RequestMapping("/services")
> @Controller
>  class MyController {
>
>  @RequestMapping("/{id1}/resource/{id2}")
>  public @ResponseBody String method1(@PathVariable String id1,
> @PathVariable
> String id2) {
>  ...
>  }
>
> }
> I will be directly writing a regular web app for Restful web services with
> much more control like I am doing right now, why do I need Camel plus
> CXFRS?
> I looked restlet approach, it solved construction for  but not for , and
> the
> configuration is very intrusive-it requires a separate servlet in addition
> to normal Camel servlet, it also requires to change appContext.xml and
> web.xml. I would use it only if it solve Restful endpoint for both  an  at
> same time.
>
> To me, solving dynamic construction of endpoint is only correct way to do
> it
> inside of Camel.
>
> Zemin
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/support-for-RESTful-endpoint-or-dynamic-endpoint-construction-tp5604487p5604487.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message