Archaius Github :: Parent

A configuration source for Archaius using GitHub

License

License

Categories

Categories

Github Development Tools Version Controls
GroupId

GroupId

io.github.nterry
ArtifactId

ArtifactId

archaius-github
Last Version

Last Version

1.2.1
Release Date

Release Date

Type

Type

pom
Description

Description

Archaius Github :: Parent
A configuration source for Archaius using GitHub
Project URL

Project URL

https://github.com/nterry/archaius-github
Source Code Management

Source Code Management

https://github.com/nterry/archaius-github

Download archaius-github

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.nterry/archaius-github/ -->
<dependency>
    <groupId>io.github.nterry</groupId>
    <artifactId>archaius-github</artifactId>
    <version>1.2.1</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/io.github.nterry/archaius-github/
implementation 'io.github.nterry:archaius-github:1.2.1'
// https://jarcasting.com/artifacts/io.github.nterry/archaius-github/
implementation ("io.github.nterry:archaius-github:1.2.1")
'io.github.nterry:archaius-github:pom:1.2.1'
<dependency org="io.github.nterry" name="archaius-github" rev="1.2.1">
  <artifact name="archaius-github" type="pom" />
</dependency>
@Grapes(
@Grab(group='io.github.nterry', module='archaius-github', version='1.2.1')
)
libraryDependencies += "io.github.nterry" % "archaius-github" % "1.2.1"
[io.github.nterry/archaius-github "1.2.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • model
  • core

Archaius configuration source for GitHub

Travis    Maven Central    SonarQube Coverage    SonarQube Tech Debt

Overview

This project provides an implementation of PolledConfigurationSource that is backed by a file hosted in either a GitHub repository or a Gist.

Usage

The best option is using a repository as it is aware of changes and will only update when a change occurs.

Here is an example usage:

DynamicConfiguration dynamicConfiguration = new DynamicConfiguration(
  new GitHubRepositoryConfigurationSource(
    new GitHubDetails("some-owner", "some-repository"), "path/to/properties/file.properties"),
    new FixedDelayPollingScheduler(10000, 10000, false));
    
String prop = dynamicConfiguration.getString("some-property");    
// There are many more methods in the DynamicConfiguration class for different types

Logging

This library uses SLF4J for logging, but there is a small caveat. Some of the dependencies for this library use java.util.commons.Logging. If you use that framework and have a logging.properties, simply put the following into your logging.properties file:

handlers = org.slf4j.bridge.SLF4JBridgeHandler

If you do not have a logging.properties, and you want to include the http client logs, simply put the following into your bootstrap code (App.main() or otherwise):

SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();

Finally, there is a HUGE performance penalty in logging if you use the bridge handler above. Fortunately, there is a simple way to fix the problem that causes said penalty. Simply put the following into your logback.xml (Assuming you use logback. If you dont, look up the equivalent for your logging framework):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

    <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
        <!-- reset all previous level configurations of all j.u.l. loggers -->
        <resetJUL>true</resetJUL>
    </contextListener> 

    ...
    ...
    ...

</configuration>

Versions

Version
1.2.1
1.2.0
1.1.1
1.0.0