Expand my Community achievements bar.

custom OSGI config - how does configMgr know which configuration file to pickup?

Avatar

Level 8

might be best explain with an example:

 

so I have this file in my node tree = /apps/myconfigs/config.publish/com.mycompany.services.myclass.config. I checked configMgr and the values for "com.mycompany.services.myclass" is completely different to the one stored in the file.

 

I know about runmodes but how does how the the publisher know the the configuration file for the class "com.mycompany.services.myclass" is exactly in this location (/apps/myconfigs/config.publish)?

 

EDIT: If I  edited/saved the values in configMgr for this class and the new config file is saved inside the default location in /apps/system/config

 

3 Replies

Avatar

Level 5

@jayv25585659 

The following order of precedence applies for OSGI configurations

  • If you have modified any config directly from system console (i.e AEM OSGi admin console) then AEM creates another .config file and this file gets precedence over your Config file, apps, or libs.
  • If you have made changes in the config file under apps and the same config has not been modified from system console then apps modified config would take the precedence over libs and will available to the application immediately.
  • If you have modified any config under libs & it is not overridden at the apps level & it is not modified from system console then modified config will take the precedence.

For run mode specific configurations, multiple run modes can be combined. Configurations in such folders will be applied if all run modes match a run mode defined at startup.
In your case there might be other configuration defined in combination with publish run mode which is taking precedence over config.publish

Avatar

Administrator

@jayv25585659 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni