Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for multiple file configuration sources #154

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

urbim
Copy link
Member

@urbim urbim commented Sep 9, 2019

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
Copy link
Member

gpor0 commented Sep 9, 2019

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