You may also need to take a look at the camel-servlet component[1]. It's not an easy job to combine the Servlet, CamelContext within the OSGi platform.
[1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: willemjiang On Thursday, September 27, 2012 at 3:21 PM, Claus Ibsen wrote: > The reslet framework have a number of extensions. You may need to use > the servlet extension to hook into the servlet container > http://wiki.restlet.org/docs_2.1/13-restlet/28-restlet/81-restlet.html > > How to configure that, I guess you need to dig in a bit. > > As we love contributions, feel free to help improve the docs. Or write > a little cookbook page etc. > > > On Wed, Sep 26, 2012 at 12:41 PM, Martin Stiborský > <[email protected] (mailto:[email protected])> wrote: > > Hello, > > I'd like to ask you for few things, I'm still missing some basic > > points I guess, so maybe it will sound like trivial, sorry for that… > > > > I need to use the restlet with Apache Camel. I need to create REST API > > with Apache Camel to offer data and also I need to consume REST API, > > from outside applications. > > > > Problem is, that I'm not really sure how to use the Restlet component > > inside Camel, with OSGi&Blueprint. > > > > For example, where and how to configure the basic route, I mean, the > > REST API you can call on "/rest/...", or where is the port configured. > > Real example - I have a Camel bundle, there I have some basic route > > with using of Restlet component, see Java code: > > > > from("restlet:http://myapp.com:1551/rest/demo/{something}") > > .process(new Processor() { > > > > @Override > > public void process(Exchange exchange) ..... skipped ... > > > > As you can see, the path to the REST call (and the server where is the > > app running) is hardcoded, that is not good…how to solve it? I know, I > > can create (somehow) some preference file and load the server > > path/rest api path it in the Java code and then use it, but is that > > the correct way? Anyway, my next question is more serious for me :) > > > > This route I've used above as example has own blueprint.xml of course, > > and there is a Camel context create for it, and there is a > > routeBuilder with reference to corresponding bean. And it works…But, > > when I have another bundle, with another Camel context, then I have to > > use another port for the restlet component, right? (Because of > > different Camel context?) And here I'm again on the wrong way I > > think…I don't know the best practices, yet, it's a little bit hard to > > start. > > > > Today, the "Camel in Action" book just arrived for me, I hope I'll > > fill the most critical knowledge gaps soon, but in the mean time, > > could you help me, guys? > > > > Thanks! > > > > > > > > -- > > S pozdravem > > Martin Stiborský > > > > Jabber: [email protected] (mailto:[email protected]) > > > > -- > Claus Ibsen > ----------------- > Red Hat, Inc. > FuseSource is now part of Red Hat > Email: [email protected] (mailto:[email protected]) > Web: http://fusesource.com > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen
