There is a need to have a tool to put and retrieve application settings from an external storage.
For example a module works with a database and has to have different DB settings (like connection url, JDBC driver etc) depending on the environment:
settings for LOCAL:
settings for UAT:
Usually this is done by placing settings in a property file or other type of independent storage and making the code read and apply the configuration during initialization stage.
Vert.x platform configuration support
There are many Java libraries that provide configuration facilities. Vert.x platform has its own tool called Vert.x Config (VC) (on github). It's a quite rich framework that:
create configuration retriever and add the store(s) to it
use the retriever to get configuration
take settings from the configuration and apply them
This works fine unless you have too many classes to configure or you can't do it in a single place and at the same moment. If your class hierarchy is big and multi-leveled or you need to get the configuration once and reuse it later on in different places then it's become a bit tricky.
Spike goals
The goal of the spike is to develop a solution on top of VC to be able to:
read configuration once and share it across class hierarchy in most convenient way
make configuration stores to be configurable themselves (do not change code if a new store to be added or changed)
support real time configuration changes for shared configuration [optional]
intergate mod-configuration with VC as another configuration storage [optional]
Intro
There is a need to have a tool to put and retrieve application settings from an external storage.
For example a module works with a database and has to have different DB settings (like connection url, JDBC driver etc) depending on the environment:
settings for LOCAL:
settings for UAT:
Usually this is done by placing settings in a property file or other type of independent storage and making the code read and apply the configuration during initialization stage.
Vert.x platform configuration support
There are many Java libraries that provide configuration facilities. Vert.x platform has its own tool called Vert.x Config (VC) (on github). It's a quite rich framework that:
offers multiple configuration syntaxes (json, properties, yaml (extension), hocon (extension)…
offers multiple configuration stores (files, directories, http, git (extension), redis (extension), system properties, environment properties)…
lets you define the processing order and overloading
supports runtime reconfiguration
can be extended with custom configuration storage and formats
Typical scenario of using VC assumes that you:
set up configuration store(s)
create configuration retriever and add the store(s) to it
use the retriever to get configuration
take settings from the configuration and apply them
This works fine unless you have too many classes to configure or you can't do it in a single place and at the same moment. If your class hierarchy is big and multi-leveled or you need to get the configuration once and reuse it later on in different places then it's become a bit tricky.
Spike goals
The goal of the spike is to develop a solution on top of VC to be able to:
read configuration once and share it across class hierarchy in most convenient way
make configuration stores to be configurable themselves (do not change code if a new store to be added or changed)
support real time configuration changes for shared configuration [optional]
intergate mod-configuration with VC as another configuration storage [optional]