Open Azquelt opened 1 year ago
Note that some other MP features may be configured via server.xml elements. Some are global, some are scoped by application. Because these server.xml elements are outside of the scope captured by the generic server.xml ConfigSource provided by the mpConfig feature, it is not entirely clear which "source" takes precedence in each case. https://github.com/OpenLiberty/open-liberty/issues/21423
From the design meeting 2023-05-30
Background
MicroProfile specifications generally allow configuration options to be set using in terms of MP Config. The supported properties are listed in the Open Liberty documentation.
MP Config is a standard way of setting config which works across different application servers. It's also works well in container environments because any MP Config property can be set via an environment variable.
In contrast, most other parts of Open Liberty config are configured using server.xml.
MP Config reads config values from several sources, some of which are specific to an application whereas others are system-wide.
Application-specific sources
microprofile-config.properties
file within the application archive<appProperties>
element within an<application>
element in server.xmlServer-wide sources
Problem
For
mpOpenApi-x.x
features, we have some config properties which are server-wide, rather than scoped to a particular application. When we read these config values, we don't consider any config sources which are application-specific.This behaviour could be unintuitive for users who are used to putting all their config which is known at build time within their application, or who are using custom config sources.
For example mpOpenAPI-2.0+ has the following config properties:
mp.openapi.extensions.liberty.merged.include
mp.openapi.extensions.liberty.merged.exclude
MicroProfile Metrics also has some config properties which are server-wide:
mp.metrics.<registry>.enabled
mp.metrics.<registry>.<property>
mp.metrics.smallrye.histogram.precision
mp.metrics.smallrye.timer.precision
mp.metrics.tags
Possible solutions
All server-wide config should be in server.xml. Only app-scoped config properties may be read from MP Config.
Continue to use MP Config for all configuration of MP features
Read config from both server.xml and MP Config