mp-config-db

ConfigurationSource for eclipse microprofile config based on a database

License

License

Categories

Categories

config Application Layer Libs Configuration
GroupId

GroupId

ch.carve
ArtifactId

ArtifactId

mp-config-db
Last Version

Last Version

0.8
Release Date

Release Date

Type

Type

jar
Description

Description

mp-config-db
ConfigurationSource for eclipse microprofile config based on a database
Project URL

Project URL

https://github.com/rikcarve/mp-config-db
Source Code Management

Source Code Management

https://github.com/rikcarve/mp-config-db.git

Download mp-config-db

How to add to project

<!-- https://jarcasting.com/artifacts/ch.carve/mp-config-db/ -->
<dependency>
    <groupId>ch.carve</groupId>
    <artifactId>mp-config-db</artifactId>
    <version>0.8</version>
</dependency>
// https://jarcasting.com/artifacts/ch.carve/mp-config-db/
implementation 'ch.carve:mp-config-db:0.8'
// https://jarcasting.com/artifacts/ch.carve/mp-config-db/
implementation ("ch.carve:mp-config-db:0.8")
'ch.carve:mp-config-db:jar:0.8'
<dependency org="ch.carve" name="mp-config-db" rev="0.8">
  <artifact name="mp-config-db" type="jar" />
</dependency>
@Grapes(
@Grab(group='ch.carve', module='mp-config-db', version='0.8')
)
libraryDependencies += "ch.carve" % "mp-config-db" % "0.8"
[ch.carve/mp-config-db "0.8"]

Dependencies

compile (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.30

provided (3)

Group / Artifact Type Version
org.eclipse.microprofile.config : microprofile-config-api jar 2.0
jakarta.platform : jakarta.jakartaee-api jar 8.0.0
org.projectlombok : lombok jar 1.18.8

test (3)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter jar 5.7.0
org.mockito : mockito-core jar 3.6.0
io.smallrye.config : smallrye-config jar 2.0.2

Project Modules

There are no modules declared in this project.

Build Status codecov Maven Central

mp-config-db

A eclipse microprofile config extension which uses a database as source.

Versions

0.7 -> Microprofile config 1.4
0.8 -> Microprofile config 2.0

Overview

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.

Add dependency

        <dependency>
            <groupId>ch.carve</groupId>
            <artifactId>mp-config-db</artifactId>
            <version>0.8</version>
        </dependency>

Configuration

Currently there are 5 values you can configure, either through Java system properties or environment variables:

  • configsource.db.datasource override 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

Ordinal

Config sources have priorities called ordinal. This config source has ordinal 450, but can be overriden with setting 'configsource.db.ordinal' in one of the default config sources (NOT in this source like specified in the spec, as the datasource is not yet ready when getOrdinal() is called).

Hint

Use memory config source from microprofile-extensions to get a REST interface and the possibility to change values on the fly (in-memory)

Links

Versions

Version
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1