GithubHelp home page GithubHelp logo

isabella232 / microprofile-config Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eclipse/microprofile-config

0.0 0.0 0.0 1.13 MB

MicroProfile Configuration Feature

License: Apache License 2.0

Java 100.00%

microprofile-config's Introduction

microprofile config microprofile config api microprofile config api

Configuration for MicroProfile

MicroProfile Config Feature

Rationale

The majority of applications need to be configured based on a running environment. It must be possible to modify configuration data from outside an application so that the application itself does not need to be repackaged.

The configuration data can come from different locations and in different formats (e.g. system properties, system environment variables, .properties, .xml, datasource). We call these config locations ConfigSources. If the same property is defined in multiple ConfigSources, we apply a policy to specify which one of the values will effectively be used.

Under some circumstances, some data sources may change dynamically. The changed values should be fed into the client without the need for restarting the application. This requirement is particularly important for microservices running in a cloud environment. The MicroProfile Config approach allows to pick up configured values immediately after they got changed.

Influences and History

There are a number of Config projects which directly influenced this proposal and acted as basis for this API, such as:

Implementations

Microprofile Config does not contain an implementation itself but only provides the specified API, a TCK and documentation.

The following Implementations are available

Design

The current configuration of an application can be accessed via ConfigProvider#getConfig().

A Config consists of the information collected from the registered org.eclipse.microprofile.config.spi.ConfigSource s. These ConfigSource s get sorted according to their ordinal. That way it is possible to overwrite configuration with lower importance from outside.

By default there are 3 default ConfigSources:

  • System.getProperties() (ordinal=400)

  • System.getenv() (ordinal=300)

  • all META-INF/microprofile-config.properties files on the ClassPath. (default ordinal=100, separately configurable via a config_ordinal property inside each file)

Therefore, the default values can be specified in the above files packaged with the application and the value can be overwritten later for each deployment. A higher ordinal number takes precedence over a lower number.

Custom ConfigSources

It is possible to write and register a custom ConfigSources. An example would be a ConfigSource which gets the configured values from a shared database table in a cluster.

Building

The whole MicroProfile config project can be built via Apache Maven

$> mvn clean install

Contributing

Do you want to contribute to this project? Find out how you can help here.

microprofile-config's People

Contributors

arend-von-reinersdorff avatar arjantijms avatar azquelt avatar bjhargrave avatar daniel-dos avatar dmlloyd avatar doychin avatar eclipse-microprofile-bot avatar emattheis avatar emily-jiang avatar gpor0 avatar gsmet avatar gunnarmorling avatar jcass149 avatar jmesnil avatar johnament avatar keilw avatar kenfinnigan avatar kwsutter avatar ljnelson avatar mcserra avatar ondromih avatar phillip-kruger avatar radcortez avatar rotty3000 avatar smillidge avatar starksm64 avatar struberg avatar tevans78 avatar xstefank avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.