[MAGNOLIA-8200] External configuration w/ MicroProfile Config (productization) Created: 30/Sep/21  Updated: 24/Jan/24

Status: Selected
Project: Magnolia
Component/s: configuration
Affects Version/s: None
Fix Version/s: None

Type: Epic Priority: Neutral
Reporter: Mikaël Geljić Assignee: Mikaël Geljić
Resolution: Unresolved Votes: 0
Labels: artt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Cloners
relation
is related to MGNLLIC-84 License module should parse the licen... Open
Template:
Epic Name: MicroProfile Config
Acceptance criteria:
Empty
Team: Foundation

 Description   

Currently, magnolia.properties are mostly looked-up in paths relative the webapp (WEB-INF/config), which forces them to be packaged within the container, together with the application. Alternatively, most projects use verbose/hard-to-manage environment variables or Java system properties as command args (-Dmagnolia.resources.dir=...) upon container build or entry-point.
 
We aim to facilitate external configuration, e.g. provided on a volume apart from the container image itself.
 
We started implementing MicroProfile Config (incubating on 6.3 feature branch), to achieve external configuration—effectively proven as a Kubernetes ConfigMap, mounted on a volume.
 
Resulting mechanism for customers would look as follows, as Smallrye (MP Config impl) allows, and similar to documented by Thorntail:

Search Paths & Explicit Configuration Files
To externalize configuration, the Java system property of thorntail.config.location or the system environment variable of THORNTAIL_CONFIG_LOCATION may be set to a system-dependent delimited set of paths. Each path is considered in turn, with increasing priority. If a path is a directory, it will be searched for appropriate configuration files matching any activated profiles. If a path is a regular file, it will be loaded, regardless of name or activated profiles.
https://docs.thorntail.io/4.0.0-SNAPSHOT/#component-config

Name of those properties are smallrye.config.location and SMALLRYE_CONFIG_LOCATION by default; prefix is configurable so we propose magnolia.config.location and MAGNOLIA_CONFIG_LOCATION, respectively.
 
As a consequence, magnolia.properties should gradually be deprecated. A MP ConfigSource should expose them for backwards compatibility. And/or a MagnoliaConfigurationProperties bridge implementation, powered by MP Config.

Preceding work

MAGNOLIA-8197 Implement bindings to MicroProfile Config API in Magnolia
MAGNOLIA-8196 Design and implement support for complex config mapping via MP Config API
MAGNOLIA-8199 React on externally provided configuration changes at runtime w/out instance redeploy
MAGNOLIA-8194 Enable support for yaml files when reading the config
MAGNOLIA-8198 Error handling for MicroProfile API
MAGNOLIA-8195 Expose MicroProfile config reload trigger via JMX
MAGNOLIA-8163 Add support to Optional<T> for @ConfigProperty and @ConfigProperties


Generated at Mon Feb 12 04:30:32 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.