felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Drake <cgdr...@infodrake.com>
Subject Re: Felix Fileinstall 3.6.0 overwriting custom .json configuration files
Date Thu, 19 Apr 2018 13:45:59 GMT
Guillaume,

Thanks for the feedback, however I'm not sure I understand how setting the
felix.fileinstall.filter will resolve the issue.  Maybe I'm
misunderstanding how things are intended to work?

We currently use the following fileinstall configuration:

PID = org.apache.felix.fileinstall.c84c4846-d3a3-4a8d-8228-223d52613459
  Factory PID = org.apache.felix.fileinstall
  BundleLocation = file:/app/bundle/org.apache.felix.fileinstall-3.5.4.jar
  felix.fileinstall.bundles.new.start = false
  felix.fileinstall.dir = /app/conf
  felix.fileinstall.filter = .*\.cfg|.*\.json
  felix.fileinstall.noInitialDelay = true
  felix.fileinstall.poll = 2000
  service.factoryPid = org.apache.felix.fileinstall
  service.pid =
org.apache.felix.fileinstall.c84c4846-d3a3-4a8d-8228-223d52613459


Our ArtifactInstaller only handles .json config files, similarly our
ConfigurationListener will only handle events for configuration objects
bound to our .json config files.

The Felix ConfigInstaller's ArtifactInstaller implementation only handles
.cfg and .config files, therefore ignoring our custom .json configuration
files. This is the expected behaviour.  However, for the
ConfigurationListener implementation all configuration events are handled
regardless of the bound configuration objects file type. As a result
Felix's ConfigInstaller overwrites our .json config files immediately after
our ConfigurationListener writes them out to disk.

Regards,
Chris

From: Guillaume Nodet <gnodet@apache.org>
> To: users@felix.apache.org
> Cc:
> Bcc:
> Date: Thu, 19 Apr 2018 07:52:00 +0200
> Subject: Re: Felix Fileinstall 3.6.0 overwriting custom .json
> configuration files
> That's definitely a change in the behavior.
> A simple workaround is to define the following property:
>
> felix.fileinstall.filter = .*\\.(cfg|config)
>
>
> 2018-04-18 22:40 GMT+02:00 Chris Drake <cgdrake@infodrake.com>:
>
> > Hello,
> >
> > We have a OSGi service registered via a Bundle activator and which
> > implements the ArtifactInstaller and ConfigurationListener interfaces.
> The
> > purpose of this service is to support loading custom .json configuration
> > files from disk, creating and updating the corresponding config via the
> > ConfigurationAdmin and writing configuration changes back out to disk.
> >
> > This service has worked well for a long time across multiple upgrades of
> > the Felix's FileInstall bundle.  Unfortunately recent changes as a result
> > of FELIX-5609 <https://issues.apache.org/jira/browse/FELIX-5609> have
> > broken this service.  Prior to FELIX-5609
> > <https://issues.apache.org/jira/browse/FELIX-5609> FileInstall was
> > restricted to handling .cfg and .config files and would ignore our
> > customized .json config files, never attempting to write them out to
> disk.
> > When we moved to FileInstall 3.6.0 we observed our .json config files
> being
> > overwritten by FileInstall's ConfigInstaller.
> >
> > I believe the above is a bug and the changes introduced by FELIX-5609
> > <https://issues.apache.org/jira/browse/FELIX-5609> should have retained
> > the
> > check restricting configuration handling to only .cfg and .confg files.
> >
> > What do you think?
> >
> > Regards,
> > Chris
> >
>
>
>
> --
> ------------------------
> Guillaume Nodet
>
>

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