Archaius Github :: Parent

A configuration source for Archaius using GitHub

Лицензия

Лицензия

Категории

Категории

Github Инструменты разработки Контроль версий
Группа

Группа

io.github.nterry
Идентификатор

Идентификатор

archaius-github
Последняя версия

Последняя версия

1.2.1
Дата

Дата

Тип

Тип

pom
Описание

Описание

Archaius Github :: Parent
A configuration source for Archaius using GitHub
Ссылка на сайт

Ссылка на сайт

https://github.com/nterry/archaius-github
Система контроля версий

Система контроля версий

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

Скачать archaius-github

Имя Файла Размер
archaius-github-1.2.1.pom 6 KB
Обзор

Как подключить последнюю версию

<!-- 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"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

  • 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>

Версии библиотеки

Версия
1.2.1
1.2.0
1.1.1
1.0.0