https://github.com/builtbyanthony/springboot-resilience4j-demo
Spring Boot app with Resilience4j for Retry & CircuitBreaker
https://github.com/builtbyanthony/springboot-resilience4j-demo
backend circuit-breaker fault-tolerance java microservices resilience4j retry-pattern spring-boot system-design
Last synced: 2 months ago
JSON representation
Spring Boot app with Resilience4j for Retry & CircuitBreaker
- Host: GitHub
- URL: https://github.com/builtbyanthony/springboot-resilience4j-demo
- Owner: builtbyanthony
- Created: 2025-07-07T02:26:32.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-07T03:05:35.000Z (12 months ago)
- Last Synced: 2025-07-16T05:46:34.600Z (12 months ago)
- Topics: backend, circuit-breaker, fault-tolerance, java, microservices, resilience4j, retry-pattern, spring-boot, system-design
- Language: Java
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Resilient Service with Spring Boot + Resilience4j
A demo Spring Boot application demonstrating the use of **Resilience4j** with `@Retry` and `@CircuitBreaker` annotations to build fault-tolerant APIs.
## 🔧 Tech Stack
- Java 17+
- Spring Boot
- Resilience4j
- Spring Boot Actuator
- Maven
## ⚙️ Features
- ✅ Auto-retries transient failures using `@Retry`
- ✅ Prevents cascading failures using `@CircuitBreaker`
- ✅ Graceful fallback responses
- ✅ Live circuit breaker status via Actuator endpoints
## 🚀 How It Works
### Simulated Unreliable Service
The service randomly throws exceptions:
```java
if (Math.random() < 0.7) {
throw new RuntimeException("Simulated failure");
}