An Eclipse MicroProfile config extension which uses a database as source.
The eclipse microprofile config framework is a simple yet powerful configuration framework for Java EE. But most implementations only provide the system/env properties or property files as configuration source. This small library provides an ConfigSource implementation which reads the values from the default datasource. For performance reasons, the config values are cached.
This config source expects JNDI & JDBC to be available. The datasource are looked up
<dependency>
<groupId>org.microprofile-ext.config-ext</groupId>
<artifactId>configsource-db</artifactId>
<version>1.x</version>
</dependency>
Currently there are 5 values you can configure, either through Java system properties or environment variables:
- configsource.db.datasource override ee default datasource by setting JNDI name of the datasource
- configsource.db.table table name for configuration records, default value is "configuration"
- configsource.db.key-column name of the column containing the key, default value is "key"
- configsource.db.value-column name of the column containing the value, default value is "value"
- configsource.db.validity how long to cache values (in seconds), default is 30s
This config source fires CDI Events on changes
Read more about Config Events
You can disable this with the configsource.db.notifyOnChanges
property:
configsource.db.notifyOnChanges=false