FAQ
Hi,

Forwarding to the users list.
On 26/03/12 15:36, Zemin Hu wrote:
Hi,
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/constrcut RESTful dynamic URL for both<from/>
and<to/>:
http://host:port/services/{uid}/table1/{item_id}
2. it supports request methods GET,POST,PUT, DELETE, I did not see how Camel
handles these methods.

Can Camel handle dynamic URL construction with variables? in ideal case, it
should support:
<from uri="servlet:///myservices/{uid}/table1/{item_id}/1.0" />
<to
uri="http://host:port/services/{uid}/table1/${header.type}?access_token=12345
/>
One option is to use a cxfrs component:
http://camel.apache.org/cxfrs.html

The variation on it is to use the Camel transport and link directly to
CXF JAXRS endpoint declarations (jaxrs:server), example

<jaxrs:server address="camel://direct:bookStore"
serviceClass="service.BookStoreImpl"/>

<camelContext xmlns="http://camel.apache.org/schema/spring">

<!-- JMS to CXF JAX-RS -->
<route>
<from uri="jms://test.bookStore"/>
<to uri="direct:bookStore"/>
</route>

<!-- Jetty to CXF JAX-RS -->
<route>
<from
uri="jetty:http://0.0.0.0:9002/bookstore?matchOnUriPrefix=true"/>
<to uri="direct:bookStore"/>
</route>
</camelContext>

HTH, Sergey
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 of out 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.
Zemin


--
View this message in context: http://camel.465427.n5.nabble.com/RESTful-web-service-support-from-Camel-tp5595408p5595408.html
Sent from the Camel Development mailing list archive at Nabble.com.

--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Search Discussions

  • Reuben Garrett at Mar 27, 2012 at 5:53 pm
    CXF is probably very relevant to your scenario, as Sergey indicates
    (although i haven't used it yet).

    for the general case of "dynamic" endpoints/URIs, check out these
    resources:

    http://camel.apache.org/dynamic-router.html
    http://camel.apache.org/recipient-list.html
    http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

    ~ Reuben
  • Reuben Garrett at Mar 29, 2012 at 4:15 pm
    Zemin,

    let's take this conversation to the users' list <users@camel.apache.org>,
    where participants focus on usage issues and will be better equipped to
    assist you.

    if you're interested in dynamic endpoint construction, take a look at these
    resources:

    http://camel.apache.org/dynamic-router.html
    http://camel.apache.org/recipient-list.html
    http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

    are any of these patterns helpful for your scenario?

    ~ Reuben
    On Thu, Mar 29, 2012 at 10:41, Zemin Hu wrote:

    To me, solving dynamic construction of endpoint is only correct way to do
    it inside of Camel.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedMar 26, '12 at 3:26p
activeMar 29, '12 at 4:15p
posts3
users2
websitecamel.apache.org

People

Translate

site design / logo © 2022 Grokbase