In this project I'm showing how you can use spring cloud circuit-breaker starter for resilience4j with resilience4j spring boot starter so you can configure externally your circuitBreaker definitions in: Spring Cloud Gateway
Currently you may find here examples of:
- Circuit Breaker and Fallback with resilience4j - the detailed explanation is my on blog: https://mromeh.com/2019/12/26/spring-cloud-gateway-with-resilience4j-circuit-breaker/
- How to mock http service using mock server test containers for micro-services integration tests
- How to configure externally in spring config Resilience4j circuit breakers and integrate it with Spring cloud circuit breaker starter
- How to configure externally in spring config Resilience4j time limter and integrate it with Spring cloud circuit breaker starter
- How to check http status code and make circuit breaker act accordingly in the spring cloud gateway
- To build and run the main application you need to have Maven, JDK8+ and Docker.
- To build it run command
mvn clean install
- During Maven build the JUnit integration tests are running. We are using Testcontainers for mocking downstream service.
Feel free to propose your code changes / extensions !