
Spring Boot Resilience4j
Adds Resilience4j fault-tolerance patterns to a Spring Boot 3.x API so outbound calls survive outages without hand-rolling retry and breaker code.
Overview
Spring Boot Resilience4j is an agent skill for the Build phase that implements Resilience4j circuit breakers, retries, rate limiters, bulkheads, time limiters, and fallbacks in Spring Boot 3.x services.
Install
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill spring-boot-resilience4jWhat is this skill?
- Covers six Resilience4j patterns: circuit breaker, retry with exponential backoff, rate limiter, bulkhead, time limiter,
- Spring Boot 3.x setup with resilience4j-spring-boot3 plus AOP wiring for annotated service methods
- Generates configuration blocks and implementation sketches aligned with Actuator health and metrics endpoints
- Combines multiple patterns on one call path for overload protection and cascading-failure isolation
- Includes validation workflow through Spring Boot Actuator to confirm breaker and retry instances are registered
- Six Resilience4j patterns: circuit breaker, retry, rate limiter, bulkhead, time limiter, and fallback
- Targets Spring Boot 3.x with resilience4j-spring-boot3 integration
- Documents validation through Spring Boot Actuator endpoints
Adoption & trust: 1.2k installs on skills.sh; 271 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your Spring Boot service calls fragile downstream APIs and one slow failure can take down the whole request path with no backoff, limits, or isolation.
Who is it for?
Indie builders on Spring Boot 3.x who call external HTTP APIs, payment gateways, or internal microservices and need copy-paste-ready resilience patterns before launch traffic hits.
Skip if: Teams on non-Spring stacks, greenfield apps with no outbound dependencies yet, or orgs that already standardize on a service mesh or gateway for all breaker policy outside the app.
When should I use this skill?
Implementing circuit breakers, handling service failures, adding retry logic with exponential backoff, configuring rate limiters, or protecting Spring Boot services from cascading failures.
What do I get? / Deliverables
You get named Resilience4j configurations, annotated service boundaries, and Actuator-checkable instances so failures stay contained and clients see controlled retries or fallbacks instead of cascades.
- Resilience4j dependency and application.yml instance definitions
- Annotated service or client methods with breaker, retry, limiter, bulkhead, and timeout annotations
- Fallback handler stubs and an Actuator-based checklist to verify registered resilience components
Recommended Skills
Journey fit
Canonical shelf is Build because the skill’s core job is implementing resilience decorators and YAML configuration inside a live Spring Boot backend, not running post-launch growth or idea research. Backend fits best: circuit breakers, retries, bulkheads, and fallbacks attach to service-layer and HTTP client integrations rather than frontend or pure PM docs.
How it compares
Use this procedural Spring Boot skill instead of ad-hoc resilience snippets—it packages Resilience4j patterns and config, not an MCP server or hosted circuit-breaker SaaS.
Common Questions / FAQ
Who is spring-boot-resilience4j for?
Solo and indie developers building Spring Boot 3.x APIs or microservices who own backend integrations and need fault tolerance without a dedicated platform team.
When should I use spring-boot-resilience4j?
Use it during Build when wiring outbound calls, and again in Ship or Operate when hardening perf and monitoring—especially for circuit breakers, exponential-backoff retries, rate limiting, bulkheads, and fallbacks on failing dependencies.
Is spring-boot-resilience4j safe to install?
Treat it like any third-party agent skill: review the Security Audits panel on this Prism page and inspect generated shell or file edits before running them in production repos.
SKILL.md
READMESKILL.md - Spring Boot Resilience4j
# Spring Boot Resilience4j Patterns ## Overview Provides Resilience4j patterns (circuit breaker, retry, rate limiter, bulkhead, time limiter, fallback) for Spring Boot 3.x fault tolerance with configuration and testing workflows. ## When to Use - Implementing fault tolerance and preventing cascading failures - Adding circuit breakers, retry logic, or rate limiting to service calls - Handling transient failures with exponential backoff - Protecting services from overload and resource exhaustion - Combining multiple patterns for comprehensive resilience ## Instructions ### 1. Setup and Dependencies Add Resilience4j dependencies to your project. For Maven, add to `pom.xml`: ```xml <dependency> <groupId>io.github.resilience4j</groupId> <artifactId>resilience4j-spring-boot3</artifactId> <version>2.2.0</version> // Use latest stable version </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> ``` For Gradle, add to `build.gradle`: ```gradle implementation "io.github.resilience4j:resilience4j-spring-boot3:2.2.0" implementation "org.springframework.boot:spring-boot-starter-aop" implementation "org.springframework.boot:spring-boot-starter-actuator" ``` Enable AOP annotation processing with `@EnableAspectJAutoProxy` (auto-configured by Spring Boot). ### 2. Circuit Breaker Pattern Apply `@CircuitBreaker` annotation to methods calling external services: ```java @Service public class PaymentService { private final RestTemplate restTemplate; public PaymentService(RestTemplate restTemplate) { this.restTemplate = restTemplate; } @CircuitBreaker(name = "paymentService", fallbackMethod = "paymentFallback") public PaymentResponse processPayment(PaymentRequest request) { return restTemplate.postForObject("http://payment-api/process", request, PaymentResponse.class); } private PaymentResponse paymentFallback(PaymentRequest request, Exception ex) { return PaymentResponse.builder() .status("PENDING") .message("Service temporarily unavailable") .build(); } } ``` Configure in `application.yml`: ```yaml resilience4j: circuitbreaker: configs: default: registerHealthIndicator: true slidingWindowSize: 10 minimumNumberOfCalls: 5 failureRateThreshold: 50 waitDurationInOpenState: 10s instances: paymentService: baseConfig: default ``` See @references/configuration-reference.md for complete circuit breaker configuration options. ### 3. Retry Pattern Apply `@Retry` annotation for transient failure recovery: ```java @Service public class ProductService { private final RestTemplate restTemplate; public ProductService(RestTemplate restTemplate) { this.restTemplate = restTemplate; } @Retry(name = "productService", fallbackMethod = "getProductFallback") public Product getProduct(Long productId) { return restTemplate.getForObject( "http://product-api/products/" + productId, Product.class); } private Product getProductFallback(Long productId, Exception ex) { return Product.builder() .id(productId) .name("Unavailable") .avai