Spring dynamic configuration

Dynamic spring beans reconfiguration from remote properties.

License

License

Categories

Categories

Configuration Application Layer Libs config
GroupId

GroupId

com.github.mpashka.spring
ArtifactId

ArtifactId

configuration
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Spring dynamic configuration
Dynamic spring beans reconfiguration from remote properties.
Project URL

Project URL

https://github.com/mpashka/spring/tree/master/configuration
Source Code Management

Source Code Management

https://github.com/mpashka/spring

Download configuration

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.mpashka.spring/configuration/ -->
<dependency>
    <groupId>com.github.mpashka.spring</groupId>
    <artifactId>configuration</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.mpashka.spring/configuration/
implementation 'com.github.mpashka.spring:configuration:1.0.0'
// https://jarcasting.com/artifacts/com.github.mpashka.spring/configuration/
implementation ("com.github.mpashka.spring:configuration:1.0.0")
'com.github.mpashka.spring:configuration:jar:1.0.0'
<dependency org="com.github.mpashka.spring" name="configuration" rev="1.0.0">
  <artifact name="configuration" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.mpashka.spring', module='configuration', version='1.0.0')
)
libraryDependencies += "com.github.mpashka.spring" % "configuration" % "1.0.0"
[com.github.mpashka.spring/configuration "1.0.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.springframework : spring-core jar 4.3.9.RELEASE
org.springframework : spring-context jar 4.3.9.RELEASE
org.springframework : spring-beans jar 4.3.9.RELEASE

test (6)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.25
org.slf4j : jcl-over-slf4j jar 1.7.25
org.apache.logging.log4j : log4j-slf4j-impl jar 2.10.0
junit : junit jar 4.12
org.hamcrest : hamcrest-library jar 1.3
org.eclipse.jetty : jetty-server jar 9.4.11.v20180605

Project Modules

There are no modules declared in this project.

This project is intended to provide spring configuraion that can be dynamically reloaded

Inspired by wuenschenswert.net

Maven dependency

<dependency>
    <groupId>com.github.mpashka.spring</groupId>
    <artifactId>configuration</artifactId>
    <version>1.0.0</version>
</dependency>

Spring context modification

In order to use this one several beans must be configured in spring context:

  • PropertySourcesPlaceholderConfigurer - core spring class to configure spring placeholder
  • EnvironmentConfigurationSource - thing to watch and reload configuration files
  • ReloadableConfigurationSupport - traverse spring configuration and find all properties that need to be reloaded
  • (Optionally) ConfigurationUpdatedEvent listener to listen configuration files updates

See package-info for more details.

See examples.

Versions

Version
1.0.0