Search code examples
aemapache-felix

change made via felix console takes more precedence over apps and libs why?


Scenario: The same configuration parameter is present under /libs/*/config and /apps/*/config and modified in both locations as well as via Felix console.

And during run-time somehow Felix console configuration is taking precedence. How? My understanding is /apps should take precedence. Any views.


Solution

  • You are correct. See http://docs.adobe.com/docs/en/cq/current/deploying/configuring_osgi.html#Configuration%20Details which states:

    The following order of precedence is used:

    1. Repository nodes under /apps/*/config....either with type sling:OsgiConfig or property files (CHECK)
    2. Repository nodes with type sling:OsgiConfig under /libs/*/config.... (ootb defns)
    3. Any .config files from /crx-quickstart/launchpad/config/.... on the local file system.

    This means that a generic configuration in /libs can be masked by a project specific configuration in /apps.

    Are the config nodes run-mode specific? If a run-mode doesn't match, that could explain why the node under apps is not getting applied:

    As the same configuration parameter can be located in several places, the system:

    • searches for all nodes of type sling:OsgiConfig
    • filters according to service name
    • filters according to run mode

    Also mentioned in the above doc, in case the changes were made when the system is running, then the following order of precedence applies:

    • Modifying a configuration in the Web console will take immediate effect as it takes precedence at runtime.
    • Modifying a configuration in /apps will take immediate effect.
    • Modifying a configuration in /libs will take immediate effect, unless it is masked by a configuration in /apps.

    This might explain why the config changes done in the OSGI console is being picked instead of the changes in your /apps.