camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Walzer, Thomas" <>
Subject AW: camel-properties enhancements
Date Fri, 04 Nov 2016 09:02:28 GMT
Hi Luca,

sounds good to me.
I use them a lot but only basic stuff. So, I never ran into your issues.
Just make sure to update the docs. This is tough stuff without examples (yours are good).

Cheers, Thomas.

-----Urspr√ľngliche Nachricht-----
Von: Luca Burgazzoli [] 
Gesendet: Donnerstag, 3. November 2016 13:30
Betreff: camel-properties enhancements

Hi everyone,

I've been working on a blueprint based applications for soem weeks and I had to deal with
a number of properties placeholders so I've used camel-properties and I found some issues/limitation
for which I've raised the following JIRA:

1. CAMEL-10352: Optionally delegate to Aries PropertyEvaluator services
   in BlueprintPropertiesParser
2. CAMEL-10393: Add an option to disable using default value if a
   property does not exists
3. CAMEL-10417: Support adding location using child nodes of
   propertyPlaceholder element
4. CAMEL-10419: Allow to individually set whether to silently ignore a
   missing location

CAMEL-10352 and CAMEL-10393 have already been merged and I've just completed the implementation
of CAMEL-10417 and CAMEL-10419 which you can find in my fork:

Before merge it I'd like to have your opinion as there are some small changes about the XML
configuration I'm going to highlight here:

1. As today, you can customize the property placeholders with the tag
   propertyPlaceholder where the attribute location is mandatory and
   that is fine untill you just want to register your own function in
   blueprint which lead to something like that:


    <propertiesFunction ref="beerFunction"/>


   So you may think that you have no locations set but that is not true
   because by default camel-blueprint detects OSGi blueprint property
   placeholders services and add them to the mix. Of course you can
   disable such behavior but I found this a little bit confusing so I
   made it not more mandatory (in fact that is the same behavior you'd
   have if you define a PropertiesComponent bean instead of using the
   propertyPlaceholder tag) and now you can now write it as:

   <propertyPlaceholder id="myPropertyPlaceholder">
    <propertiesFunction ref="beerFunction"/>

2. As today to add new properties placeholder locations you need to set
   them with the location attribute using comma as separator and this
   work just fine but it may result confusing if you need to deal with a
   number of properties files. In addition you can't set which location
   is required and which may be missing as the option to ignore missing
   location is global so I've enhanced the propertyPlaceholder tag in a
   way you can add locations as:

   <propertyPlaceholder id="myPropertyPlaceholder">

      resolver = "classpath"
      path     = "com/my/company/something/"
      optional = "false"/>

      resolver = "classpath"
      path     = "com/my/company/something/"
      optional = "false"/>

      resolver = "file"
      path     = "${karaf.home}/etc/"
      optional = "true"/>


   Note that the attribute resolver and optional are not mandatory and
   have classpath and false as default value respectivley.

   Of course setting locations via location attribute is still supported
   and it has been enhanced to support additional attributes, i.e.:


   Note that the locations defined by the propertiesLocation tag are
   added to those defined in location attribute.

Any objection/suggestion on such implementation ?


Luca Burgazzoli
View raw message