You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Matteo Rulli <ma...@gmail.com> on 2018/08/28 08:17:08 UTC

Config feature element used as default

Hello,
I would like to know what is the expected behavior of the <config name="the.config.pid"> feature element when the the.config.pid.cfg file already exists in the karaf /etc folder. What properties are injected in the service? Those in the file or those in the <config name="the.config.pid”> feature element?

I'm asking this because I would like to use the content of the <config name="the.config.pid”> element as a default value only when the corresp file in etc folder is missing. When the file is already present I’d like to get a similar behaviour with respect <configfile finalname="${karaf.etc}/the.config.pid.cfg" override="false">

Thank you,
Matteo

Re: Config feature element used as default

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Matteo,

by default, the existing config is not overriden. So, the config in etc
are taken, whatever is contain in the feature.

However, it can happen in two steps: first loaded from the feature and
after reloaded from the cfg file. So, your bundle has to react correctly
to config updates.

Regards
JB

On 28/08/2018 10:17, Matteo Rulli wrote:
> Hello,
> I would like to know what is the expected behavior of the <config
> name="the.config.pid"> feature element when the the.config.pid.cfg file
> already exists in the karaf /etc folder. What properties are injected in
> the service? Those in the file or those in the <config
> name="the.config.pid”> feature element?
> 
> I'm asking this because I would like to use the content of the <config
> name="the.config.pid”> element as a default value only when the corresp
> file in etc folder is missing. When the file is already present I’d like
> to get a similar behaviour with respect <configfile
> finalname="${karaf.etc}/the.config.pid.cfg" override="false">
> 
> Thank you,
> Matteo

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com