Restriction in RestConfiguration with blueprint

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Restriction in RestConfiguration with blueprint

arnaudeprez
Hi riders,

In camel 2.16.X, I was able to use configure a RestConfiguration in
blueprint with property placeholder as bellow:

<camelContext id="rest-api" allowUseOriginalMessage="false" xmlns="
http://camel.apache.org/schema/blueprint">
    <restConfiguration component="{{camel.rest.component}}"
port="{{camel.rest.port}}" contextPath="{{camel.rest.contextPath}}"/>
   ....
</camelContext>

But since camel 2.16.3 and also in camel 2.17.X and 2.18-SNAPSHOT, it
doesn't work anymore, it is actually unable to resolve the property
placeholder and says that ie. camel can't found a RestConsumerFactory
{{camel.rest.component}}
in the registry.

I think it's related to the fix bring with issue:
https://issues.apache.org/jira/browse/CAMEL-9483

So, according to me, here:
https://github.com/apache/camel/commit/b1555bae4a878135a8681d9bbe895f1f97c96870
at line 996, I think, we should have something like:
String component = CamelContextHelper.parseText(camelContext,
ccfb.getRestConfiguration().getComponent());
instead of
String component = ccfb.getRestConfiguration().getComponent();

Apparently, I can't create a jira issue (can't actually select the Camel
project).
I didn't have time to test it yet, but I'll try to do it soon when I have.

I might also be wrong so please don't hesitate to correct me if I am or
give me some advice if needed.

Regards
--
Arnaud Deprez
Software Engineer
Phone: +32 497 23 30 44
Linked'In: https://www.linkedin.com/in/deprezarnaud
Github: https://github.com/arnaud-deprez
Reply | Threaded
Open this post in threaded view
|

Re: Restriction in RestConfiguration with blueprint

Claus Ibsen-2
Hi

Yeah we should avoid setting up those dependencies from the parser if
they values are using property placeholders
https://issues.apache.org/jira/browse/CAMEL-9963

On Wed, May 11, 2016 at 11:48 PM, Arnaud Deprez <[hidden email]> wrote:

> Hi riders,
>
> In camel 2.16.X, I was able to use configure a RestConfiguration in
> blueprint with property placeholder as bellow:
>
> <camelContext id="rest-api" allowUseOriginalMessage="false" xmlns="
> http://camel.apache.org/schema/blueprint">
>     <restConfiguration component="{{camel.rest.component}}"
> port="{{camel.rest.port}}" contextPath="{{camel.rest.contextPath}}"/>
>    ....
> </camelContext>
>
> But since camel 2.16.3 and also in camel 2.17.X and 2.18-SNAPSHOT, it
> doesn't work anymore, it is actually unable to resolve the property
> placeholder and says that ie. camel can't found a RestConsumerFactory
> {{camel.rest.component}}
> in the registry.
>
> I think it's related to the fix bring with issue:
> https://issues.apache.org/jira/browse/CAMEL-9483
>
> So, according to me, here:
> https://github.com/apache/camel/commit/b1555bae4a878135a8681d9bbe895f1f97c96870
> at line 996, I think, we should have something like:
> String component = CamelContextHelper.parseText(camelContext,
> ccfb.getRestConfiguration().getComponent());
> instead of
> String component = ccfb.getRestConfiguration().getComponent();
>
> Apparently, I can't create a jira issue (can't actually select the Camel
> project).
> I didn't have time to test it yet, but I'll try to do it soon when I have.
>
> I might also be wrong so please don't hesitate to correct me if I am or
> give me some advice if needed.
>
> Regards
> --
> Arnaud Deprez
> Software Engineer
> Phone: +32 497 23 30 44
> Linked'In: https://www.linkedin.com/in/deprezarnaud
> Github: https://github.com/arnaud-deprez



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Restriction in RestConfiguration with blueprint

arnaudeprez
Yeah, I agree Claus.

That's why I'm not a big fan of my proposed solution, It would be cleaner
if the CamelContext (or CamelContextFactoryBean) itself resolved
PropertyPlaceHolder on its own without regarding the implementation
(spring, blueprint, cdi, whatever).

Regards,

On Fri, May 13, 2016 at 7:42 AM Claus Ibsen <[hidden email]> wrote:

> Hi
>
> Yeah we should avoid setting up those dependencies from the parser if
> they values are using property placeholders
> https://issues.apache.org/jira/browse/CAMEL-9963
>
> On Wed, May 11, 2016 at 11:48 PM, Arnaud Deprez <[hidden email]>
> wrote:
> > Hi riders,
> >
> > In camel 2.16.X, I was able to use configure a RestConfiguration in
> > blueprint with property placeholder as bellow:
> >
> > <camelContext id="rest-api" allowUseOriginalMessage="false" xmlns="
> > http://camel.apache.org/schema/blueprint">
> >     <restConfiguration component="{{camel.rest.component}}"
> > port="{{camel.rest.port}}" contextPath="{{camel.rest.contextPath}}"/>
> >    ....
> > </camelContext>
> >
> > But since camel 2.16.3 and also in camel 2.17.X and 2.18-SNAPSHOT, it
> > doesn't work anymore, it is actually unable to resolve the property
> > placeholder and says that ie. camel can't found a RestConsumerFactory
> > {{camel.rest.component}}
> > in the registry.
> >
> > I think it's related to the fix bring with issue:
> > https://issues.apache.org/jira/browse/CAMEL-9483
> >
> > So, according to me, here:
> >
> https://github.com/apache/camel/commit/b1555bae4a878135a8681d9bbe895f1f97c96870
> > at line 996, I think, we should have something like:
> > String component = CamelContextHelper.parseText(camelContext,
> > ccfb.getRestConfiguration().getComponent());
> > instead of
> > String component = ccfb.getRestConfiguration().getComponent();
> >
> > Apparently, I can't create a jira issue (can't actually select the Camel
> > project).
> > I didn't have time to test it yet, but I'll try to do it soon when I
> have.
> >
> > I might also be wrong so please don't hesitate to correct me if I am or
> > give me some advice if needed.
> >
> > Regards
> > --
> > Arnaud Deprez
> > Software Engineer
> > Phone: +32 497 23 30 44
> > Linked'In: https://www.linkedin.com/in/deprezarnaud
> > Github: https://github.com/arnaud-deprez
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>
--
Arnaud Deprez
Software Engineer
Phone: +32 497 23 30 44
Linked'In: https://www.linkedin.com/in/deprezarnaud
Github: https://github.com/arnaud-deprez