Skip to content

Added support for multiple file configuration sources#154

Open
urbim wants to merge 2 commits into
masterfrom
feature/multipleFileConfigSources
Open

Added support for multiple file configuration sources#154
urbim wants to merge 2 commits into
masterfrom
feature/multipleFileConfigSources

Conversation

@urbim

@urbim urbim commented Sep 9, 2019

Copy link
Copy Markdown
Member

Enabled usage of multiple file configuration sources. For example now you can define both config.yml and META-INF/microprofile-config.properties at the same time.

Also additional custom file configuration sources can be defined. For example:

config.yml:

example-value: 123

kumuluzee:
  config:
    additional-config-files:
      - config.prod.yml
      - config.docker.yml

config.prod.yml:

example-value: 456

kumuluzee:
  server:
    http:
      port: 8090

config.docker.yml:

another-example: from-docker-yaml

The property example-value will be 456 (additional config files override the default configuration files).

Ordinals

The default configuration files will have an ordinal of 100 (101, 102, ... if more than one are present).

Additional configuration files will have an ordinal one higher than the highest ordinal of the default configuration files. If more than one additional configuration files are defined the one with the smallest index will have the highest ordinal.

In the example above, the config.yml will have an ordinal of 100 (lowest priority), the config.docker.yml will have an ordinal of 101 and the config.prod.yml will have an ordinal of 102 (highest priority).

Of course, every ordinal can be manually set by defining the config_ordinal property in the configuration source (as per MicroProfile Config specification). For example:

config.docker.yml:

config_ordinal: 200

another-example: from-docker-yaml

@urbim urbim added the Feature label Sep 9, 2019
@urbim urbim self-assigned this Sep 9, 2019
@gpor0

gpor0 commented Sep 9, 2019

Copy link
Copy Markdown
Member

Hi there!

Thumbs up for the feature.

How does com.kumuluz.ee.configuration.file setting affects this feature?

Is it possible to define default config.yml in project and override it with file specified in com.kumuluz.ee.configuration.file setting? I believe com.kumuluz.ee.configuration.file file must have config_ordinal > 100 then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants