Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[config-dev] Meta configuration
  • From: Tomas Langer <tomas.langer@xxxxxxxxxx>
  • Date: Tue, 17 Aug 2021 13:40:19 +0000
  • Accept-language: cs-CZ, en-US
  • Arc-authentication-results: i=1; 1; spf=pass; dmarc=pass action=none; dkim=pass; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed;; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vim0VHlGYLAUkJzFDW22jWL7Yx22OHSr03em83/cGHY=; b=oWRf8C9JcbX1k7UPyMYip82WPXnmzCELjNqsj8HUsFhT4D7jh+UmYZzfhACcVSF3N+AIGZY+j2yWaJLUOivDGmUyOIRvvpg09X7VGhUrPkwriBfS6MxeQHPn1cjNLsrI/S5mSBf9/EgI4lyDlu4prhCKkEjd+zRcDhnn3MOa9YXnK+sUy4oSA+OIw/w3yPjuMzxukqzN9y+OqsZROrdWz2n1nKTg2bKKkRD2chcsGh1DInRBWMKeKKxOtkxHd2eJ4/p9Xst+EgCMKkYf/Jvzx6M6ynvDi0swR9qP85ctXyDLIFbvA1l+US0YQC+wky6KNDgB86Lu1lL38Eu9iFN26A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901;; cv=none; b=HGwGxmOHwE5AGWqj563Fu7d0iWNA/1MsRuIgxfy/p1oeUE9VzW2AcdYv/vRBT9WKkrHp8yH8wo46+dSdHZlqfubxw4zECnTAimUs68WAPFTq3Pevc5cRm3Jx928y46AtfUxH/tJCfIKluUURyAR0RYS07NtourmWM8ib4nvDtHjmF/VZvFgKjErlfeSCbGJvTYp4aNwVe2V4xiTdQGXahqqnantNazaGva3Q8CDBTu1dKeqyK7c0mz5Bt0fDTWpwV2e7FFCnyFNLpTeDKX2dJ5kGS4L3nQ/6WAfLphB8uPidviaTJRuOLoihxEaXwl+SlbLqKFYj9BkepshDl8gqQw==
  • Delivered-to: config-dev@xxxxxxxxxxx
  • List-archive: <>
  • List-help: <>
  • List-subscribe: <>, <>
  • List-unsubscribe: <>, <>
  • Thread-index: AQHXk21rmO9P7P8sBkGjaKsbDL9Grw==
  • Thread-topic: Meta configuration

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
- type: "system-properties"
- type: "environment-variables"
- type: "yaml"
path: application.yaml"
- type: "yaml"
optional: true
classpath: "application.yaml"
- type: "properties"
classpath: "META-INF/"

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

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

Back to the top