This project shows how to leverage Resilience4j together with Spring Cloud Circuit Breaker.
Spring Cloud Circuit Breaker (SCCB) is a young project from the Spring Framework. Using SCCB you get an abstraction layer over many circuit breaker implementations, such as:
- Resilience4j
- Spring Retry
- Sentinel
- Netflix Hystrix (now in maintenance mode)
This way you can easily switch from an implementation to another one, with no to low impact in your source code.
Let's see how you can leverage Resilience4j with your Spring Boot app.
Compile this app using a JDK 11+:
$ ./mvnw clean package
Start the app:
$ java -jar target/springboot-resilience4j-demo.jar