Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [config-dev] Meta configuration

nice feature. Except the yaml ;)

LieGrue,
strub

Am 17.08.2021 um 15:40 schrieb Tomas Langer <tomas.langer@xxxxxxxxxx>:

As I promised on the weekly call, here is the example of meta-configuration we use for MP Config (and also the one we use for our config):

This configuration is based on the current MP API for setting up Config:
YAML structure (as it contains ordered arrays) - could be handled by properties (if indexing is used), json etc.

This is a bit limited by the fact that parsers are bound to the source, so a combination of
type + source must be defined (e.g. both properties and YAML source must support classpath, files and URL)

profile: "test"
add-discovered-converters: true
add-discovered-sources: false
add-default-sources: false
sources:
- type: "system-properties"
- type: "environment-variables"
- type: "yaml"
path: application.yaml"
- type: "yaml"
optional: true
classpath: "application.yaml"
- type: "properties"
classpath: "META-INF/jakarta-config.properties"

The default location could be META-INF/meta-config.yaml, which can be overridden at runtime using environment variable or system property (such as -Djakarta.config.meta-config=/etc/conifg/meta-config.yaml)




The following structure could be used if we support independent parsers (taken from Helidon Config):

Supported types (could be required by the spec):
- system-properties
- environment-variables
- classpath (requires resource property)
- file (requires path property)
- url (requires url property)
- inlined (configuration data is part of the meta config itself - useful for testing)
Other types that could be supported (this is extensible through service loader, so anything can be done):
- directory (such as each file in the directory is a configuration file prefixed with the file name)
- git (specific file in a git repository)
- etcd

sources:
- type: "file"
properties:
path: "conf/dev.yaml"
optional: true
- type: "classpath"
multi-source: true # Can yield more than one independent config source
properties:
resource: "META-INF/jakarta-config.properties"

_______________________________________________
config-dev mailing list
config-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://accounts.eclipse.org


Back to the top