camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller <christian.muel...@gmail.com>
Subject Re: Restlet component with OSGi/Blueprint
Date Wed, 26 Sep 2012 18:52:04 GMT
Use a properties placeholder like here [1].
You could also use the Camel provided properties component [2].
The FAQ entry [3] could be also useful for you.

[1]
https://svn.apache.org/repos/asf/camel/trunk/components/camel-blueprint/src/test/resources/test.xml
[2] http://camel.apache.org/using-propertyplaceholder.html
[3]
https://camel.apache.org/how-do-i-use-spring-property-placeholder-with-camel-xml.html

Best,
Christian

On Wed, Sep 26, 2012 at 12:41 PM, Martin Stiborský <
martin.stiborsky@gmail.com> 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: stibi@njs.netlab.cz
>



--

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