giuseppe-trisciuoglio/developer-kit/spring-boot-resilience4j
- community
Checking that the SKILL.md file is still in the repository.
Provides fault tolerance patterns for Spring Boot 3.x using Resilience4j. Use when implementing circuit breakers, handling service failures, adding retry logic with exponential backoff, configuring rate limiters, or protecting services from cascading failures. Generates circuit breaker, retry, rate limiter, bulkhead, time limiter, and fallback implementations. Validates resilience configurations through Actuator endpoints.
Install
npx vskill@latest install giuseppe-trisciuoglio/developer-kit/spring-boot-resilience4jSKILL.md
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:
For Gradle, add to build.gradle:
Enable AOP annotation processing with @EnableAspectJAutoProxy (auto-configured by Spring Boot).
2. Circuit Breaker Pattern
Apply @CircuitBreaker annotation to methods calling external services:
Configure in application.yml:
See @references/configuration-reference.md for complete circuit breaker configuration options.
3. Retry Pattern
Apply @Retry annotation for transient failure recovery:
Configure retry in application.yml:
See @references/configuration-reference.md for retry exception configuration.
4. Rate Limiter Pattern
Apply @RateLimiter to control request rates:
Configure in application.yml:
5. Bulkhead Pattern
Apply @Bulkhead to isolate resources. Use type = SEMAPHORE for synchronous methods:
Use type = THREADPOOL for async/CompletableFuture methods:
Configure in application.yml:
6. Time Limiter Pattern
Apply @TimeLimiter to async methods to enforce timeout boundaries:
Configure in application.yml:
7. Combining Multiple Patterns
Stack multiple patterns on a single method for comprehensive fault tolerance:
Execution order: Retry → CircuitBreaker → RateLimiter → Bulkhead → Method
All patterns should reference the same named configuration instance for consistency.
8. Exception Handling and Monitoring
Create a global exception handler using @RestControllerAdvice:
Enable Actuator endpoints for monitoring resilience patterns in application.yml:
Access monitoring endpoints:
GET /actuator/health- Overall health including resilience patternsGET /actuator/circuitbreakers- Circuit breaker statesGET /actuator/metrics- Custom resilience metrics
Testing & Verification Workflow
- Circuit Breaker: Call endpoint with failures → check
GET /actuator/circuitbreakersshowsOPEN→ waitwaitDurationInOpenState→ verify state transitions toHALF_OPEN→CLOSED
- Retry: Enable
resilience4j.retry.metrics.enabled: true→ invoke endpoint → verifyretry.{instance}.successful-calls-with-retry-attemptsmetric increases
- Rate Limiter: Send requests exceeding
limitForPeriod→ verify 429 status → checkGET /actuator/ratelimitersshowsLIMITED
- Bulkhead: Load test with concurrent requests exceeding
maxConcurrentCalls→ verify excess requests fail immediately withBulkheadFullException
- Time Limiter: Mock async delay beyond
timeoutDuration→ verify fallback triggers after timeout
See @references/testing-patterns.md for unit and integration testing strategies.
Best Practices
- Provide fallback methods: Ensure graceful degradation with meaningful responses
- Use exponential backoff: Prevent overwhelming recovering services (
exponentialBackoffMultiplier: 2) - Set appropriate thresholds:
failureRateThresholdbetween 50-70% - Use constructor injection: Never use field injection for Resilience4j dependencies
- Enable health indicators: Set
registerHealthIndicator: truefor all patterns - Retry only transient errors: Network timeouts, 5xx; skip 4xx and business exceptions
- Size bulkheads based on load: Calculate thread pool and semaphore sizes from expected concurrency
- Document fallback behavior: Make fallback logic clear and predictable
Constraints and Warnings
- Fallback methods must have the same signature plus an optional exception parameter
- Circuit breaker state is per-instance; ensure proper bean scoping in multi-tenant scenarios
- Retry operations must be idempotent (may execute multiple times)
- Do not use circuit breakers for operations that must always complete; use timeouts instead
- Rate limiters can cause thread blocking; configure appropriate wait durations
- Be cautious with
@Retryon non-idempotent operations like POST requests - Monitor memory when using thread pool bulkheads with high concurrency
Examples
Before → After: Circuit Breaker
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/developer-kit-java/skills/spring-boot-resilience4j/SKILL.md
Popularity
- Repository stars
- 249
- Repository forks
- 27
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 20 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/giuseppe-trisciuoglio/developer-kit/spring-boot-resilience4j)