io.github.melangad:spring-config-rest-client

Client implementation for alternative implementation of Spring Cloud Config server

License

License

Categories

Categories

CLI User Interface config Application Layer Libs Configuration
GroupId

GroupId

io.github.melangad
ArtifactId

ArtifactId

spring-config-rest-client
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

io.github.melangad:spring-config-rest-client
Client implementation for alternative implementation of Spring Cloud Config server
Project URL

Project URL

https://github.com/melangad/spring-config-rest-client
Source Code Management

Source Code Management

http://github.com/melangad/spring-config-rest-client/tree/master

Download spring-config-rest-client

How to add to project

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

Dependencies

compile (6)

Group / Artifact Type Version
org.springframework : spring-core jar
org.springframework.boot : spring-boot-starter-web jar
org.springframework : spring-web jar
org.springframework.boot : spring-boot-starter-actuator jar
org.springframework.boot : spring-boot-starter-webflux jar
org.projectreactor : reactor-spring jar 1.0.1.RELEASE

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar

Project Modules

There are no modules declared in this project.

Build Status

Introduction

This is an alternative for Spring Cloud Config which has its own client and server. This project is for the client component of the config server.

The server component is using database as the configuration source. Please refer to server project more details on server features.

Client

Client can be easily integrated with any Spring Boot project. Client provides following features at the moment.

  • Retrieve latest configurations from the Config Server
  • Actuator endpoint to query the configuration version and last update timestamp on the client side

Quick Start

To use the client side in your application, add following dependency on your pom.xml file.

[source,xml,indent=0] .pom.xml

<dependency>
    <groupId>io.github.melangad</groupId>
    <artifactId>spring-config-rest-client</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>

If you need to enable the Actuator, create following beans under a Spring Configuration.

@Autowired
Environment environment;

@Bean
public ConfigManager configManager() {
    return new ConfigManager(environment);
}

@Bean
public ConfigReportEndpoint configReportEndpoint() {
    return new ConfigReportEndpoint();
}

Configurations

You can enable or disable Config Client using following property

io.github.melangad.spring.config.remote.enable=true

Use following property to set the config server URI SERVER_HOST - Config Server Host & port

io.github.melangad.spring.config.server.url=http://SERVER_HOST/config

Configurations are stored in the server against a unique label and you need to provide the label in the configurations.

io.github.melangad.spring.config.label=LABEL

If server has feedback endpoint and if you need to provide state of the client configuration as a feedback to the server, set feedback endpoint.

io.github.melangad.spring.config.server.feedbackur=http://SERVER_HOST/config/feedback

Config Manage

Config Manager provides several APIs to query configuration state.

  • Current Configuration version
  • Last update time of the configuration on client side
  • Method to invoke feedback call. You need to provide a unique client ID on invoking feedback

Versions

Version
0.1.0
0.0.1