Skip to content
A Spring Cloud 2 demo which shows how to use the Resilience4j Spring Cloud 2 Starter
Java
Branch: master
Clone or download
Robert Winkler
Robert Winkler Updated to v1.0.0
Latest commit 6140482 Sep 16, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
client
gradle/wrapper
server Changed project name Sep 4, 2019
.gitignore Resilience4j-spring-cloud2-demo Aug 14, 2019
README.md Update README.md Sep 2, 2019
build.gradle
gradlew
gradlew.bat Resilience4j-spring-cloud2-demo Aug 14, 2019
settings.gradle Changed project name Sep 2, 2019

README.md

resilience4j-spring-cloud2-demo

Setup

If you want to use resilience4j with Spring Cloud Config, add the Spring Cloud2 Starter of Resilience4j to your compile dependency.

repositories {
  jCenter()
}

dependencies {
  compile "io.github.resilience4j:resilience4j-spring-cloud2:${resilience4jVersion}"
}

Configuration

The configuration is similar to resilience4j-spring-boot2.

Demo

Setup and usage in Spring Cloud 2 with Spring Boot 2 is demonstrated in this demo.

There are two modules in demo. server module is spring-cloud-config server. It serves config files inside the config branch. client module is Spring Boot 2 application with spring-cloud-config.

Getting Started

  1. Start the server module.
  • It works as spring-cloud-config server.
  1. Start the client module after server module is up.
  • client application will fetch application.yml from server module.
  1. Request to http://localhost:8080/check.
  • You can see the Resilience4j's default config value in application.yml served by server module.
  1. Edit some config values in config branch for checking changes is applied to registries.

  2. Request to http://localhost:8080/actuator/refresh for refreshing Registry's config.

  • Edited configs will be applied to registries.
  1. Request to http://localhost:8080/check again.
  • You can see the edited config values.
You can’t perform that action at this time.