https://github.com/romeh/spring-cloud-gateway-resilience4j
Sample spring cloud gateway project to show how to use resilience4j as a gateway circuitbreaker
https://github.com/romeh/spring-cloud-gateway-resilience4j
circuit-breaker mock-server resilience4j spring-boot-2 spring-boot-starter spring-cloud-gateway test-containers
Last synced: 6 months ago
JSON representation
Sample spring cloud gateway project to show how to use resilience4j as a gateway circuitbreaker
- Host: GitHub
- URL: https://github.com/romeh/spring-cloud-gateway-resilience4j
- Owner: Romeh
- License: apache-2.0
- Created: 2019-12-24T18:08:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-25T16:23:13.000Z (over 5 years ago)
- Last Synced: 2025-03-24T13:50:44.486Z (7 months ago)
- Topics: circuit-breaker, mock-server, resilience4j, spring-boot-2, spring-boot-starter, spring-cloud-gateway, test-containers
- Language: Java
- Size: 46.9 KB
- Stars: 35
- Watchers: 1
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Spring Cloud Gateway with Resilient4J circuit breaker
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](https://cloud.spring.io/spring-cloud-gateway/reference/html/)## Getting Started
Currently you may find here examples of:
1. Circuit Breaker and Fallback with [resilience4j](https://resilience4j.readme.io/docs/getting-started) - the detailed explanation is my on blog: https://mromeh.com/2019/12/26/spring-cloud-gateway-with-resilience4j-circuit-breaker/
2. How to mock http service using mock server test containers for micro-services integration tests
3. How to configure externally in spring config Resilience4j circuit breakers and integrate it with Spring cloud circuit breaker starter
4. How to configure externally in spring config Resilience4j time limter and integrate it with Spring cloud circuit breaker starter
5. How to check http status code and make circuit breaker act accordingly in the spring cloud gateway### Usage
1. To build and run the main application you need to have Maven, JDK8+ and Docker.
2. To build it run command `mvn clean install`
3. During Maven build the JUnit integration tests are running. We are using [Testcontainers](https://www.testcontainers.org/) for mocking downstream service.Feel free to propose your code changes / extensions !