»cfg4j« is a modern configuration library for distributed apps written in Java.

Release 4.0.0

»cfg4j« 4.0.0 released!

We're proud to announce the 4.0.0 release of »cfg4j«. Learn more about new features in this article.

Changes

New features

  • add YAML support
  • PeriodicalReloadStrategy now supports multiple providers (one extra thread instead of many)
  • new builders for configuration sources for easier construction
  • add toString() methods for better logging
  • cfg4j is now split into 3 modules:
    • cfg4j-core - contains core classes and configuration sources (Files, Classpath, Merge, Fallback, Empty)
    • cfg4j-consul - contains Consul configuration source
    • cfg4j-git - contains Git configuration source

Fixes

  • better logging messages

Interface changes

Renames & moves

  • EnvironmentBasedBranchResolver -> FirstTokenBranchResolver
  • EnvironmentBasedPathResolver -> AllButFirstTokenPathResolver
  • Refreshable -> Reloadable
  • RefreshStrategy -> ReloadStrategy
  • OnInitRefreshStrategy -> ImmediateReloadStrategy
  • PeriodicalRefreshStrategy -> PeriodicalReloadStrategy
  • rename package: refresh -> reload
  • reorganized org.cfg4j.source package

Changes

  • ConfigFilesProvider.getConfigFiles() returns Iterable instead of Iterable
  • GitConfigurationSource now throws IllegalStateException and SourceCommunicationException instead of GitConfigurationSourceException

Removals

  • removed deprecated ConfigurationSource.getConfiguration()
  • removed deprecated PeriodicalRefreshStrategy(long refreshAfterMs) constructor
  • removed ConfigurationProviders class
  • removed ConfigurationProvider.getProperty(String key)

Other

  • upgraded dependencies

4.0.0 artifacts

Installation

Gradle

dependencies {
  compile group: "org.cfg4j", name:"cfg4j-core", version: "4.0.0"

  // Optional plug-ins

  // Consul integration
  compile group: "org.cfg4j", name:"cfg4j-consul", version: "4.0.0"

  // Git integration
  compile group: "org.cfg4j", name:"cfg4j-git", version: "4.0.0"
}

Maven

<dependencies>
  <dependency>
    <groupId>org.cfg4j</groupId>
    <artifactId>cfg4j-core</artifactId>
    <version>4.0.0</version>
  </dependency>
  
  <!-- Optional plug-ins -->
  
  <!-- Consul integration -->
  <dependency> 
    <groupId>org.cfg4j</groupId>
    <artifactId>cfg4j-consul</artifactId>
    <version>4.0.0</version>
  </dependency>
  
  <!-- Git integration -->
  <dependency>
    <groupId>org.cfg4j</groupId>
    <artifactId>cfg4j-git</artifactId>
    <version>4.0.0</version>
  </dependency>
</dependencies>