spring-boot-resilience4j_skill

This skill helps you implement fault tolerance in Spring Boot apps using Resilience4j by adding circuit breakers, retries, rate limiters, bulkheads, and
  • Python

99

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill giuseppe-trisciuoglio/developer-kit --skill spring-boot-resilience4j

  • SKILL.md15.2 KB

Overview

This skill shows how to implement fault tolerance and resilience patterns in Spring Boot applications using Resilience4j. It explains where to apply circuit breaker, retry, rate limiter, bulkhead, time limiter, and fallback mechanisms so microservices handle external failures gracefully. The content focuses on practical configuration, annotations, and monitoring tips for Spring Boot 3.x.

How this skill works

The skill integrates Resilience4j annotations (@CircuitBreaker, @Retry, @RateLimiter, @Bulkhead, @TimeLimiter) with Spring Boot AOP to wrap service calls and enforce policies. Configuration is provided via application.yml to define named instances and shared configs. Fallback methods, Actuator endpoints and a global exception handler provide graceful degradation and observability.

When to use it

  • Protect downstream HTTP or RPC calls from cascading failures with a circuit breaker
  • Automatically retry transient errors with exponential backoff for network hiccups and 5xx responses
  • Limit request rates to avoid overwhelming downstream services or your own endpoints
  • Isolate resources using bulkheads to prevent thread pool exhaustion or shared resource saturation
  • Enforce timeouts on async processing with time limiters to bound latency
  • Combine patterns on critical flows (retry + circuit breaker + bulkhead + rate limiter) for comprehensive resilience

Best practices

  • Always supply meaningful fallback methods to return predictable degraded responses
  • Retry only idempotent or safe operations; prefer exponential backoff to reduce strain on recovering services
  • Tune failure thresholds and window sizes based on production traffic and acceptable error rates
  • Use constructor injection for services and clients; avoid field injection for testability
  • Enable health indicators and Actuator endpoints to monitor circuit breakers, retries and rate limiters
  • Document fallback behavior and ensure monitoring alerts reflect degraded service modes

Example use cases

  • Wrap payment or billing client calls with a circuit breaker and fallback that queues requests for later processing
  • Apply @Retry with exponential backoff to product catalog reads that occasionally return transient 503 errors
  • Rate limit notification or email endpoints to protect third-party providers from burst traffic
  • Use thread-pool bulkhead for heavy analytics jobs to isolate CPU-bound tasks from request handling threads
  • Add @TimeLimiter to search endpoints backed by slow third-party search engines and return an empty result fallback

FAQ

Start with conservative defaults (slidingWindowSize 10, failureRateThreshold 50%) and adjust using production metrics. Tune according to error patterns and acceptable failure modes.

Can I stack multiple Resilience4j annotations on one method?

Yes. Common stacks are Retry → CircuitBreaker → RateLimiter → Bulkhead. Reference the same named configuration for consistency and ensure order matches expected behavior.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
spring-boot-resilience4j skill by giuseppe-trisciuoglio/developer-kit | VeilStrat