From java-spring
Implements Resilience4J patterns including circuit breaker, retry, rate limiter, bulkhead, and timeout in Spring Boot projects to handle service failures. Reviews existing configs.
npx claudepluginhub ducpm2303/claude-java-plugins --plugin java-springThis skill is limited to using the following tools:
Detect the existing setup, then apply the correct pattern.
Implements Resilience4j fault tolerance for Spring Boot 3.x: circuit breakers, retries with backoff, rate limiters, bulkheads, time limiters, fallbacks, and Actuator validation for service failures.
Detects missing resilience patterns like circuit breakers, rate limiting, bulkheads, retries, and timeouts in external dependencies (APIs, DBs, queues). Analyzes failure modes and recommends production configurations.
Assists implementing circuit breakers, retries, bulkheads, and resilience patterns for fault-tolerant distributed systems.
Share bugs, ideas, or general feedback.
Detect the existing setup, then apply the correct pattern.
Check pom.xml or build.gradle:
resilience4j-spring-boot3 → Spring Boot 3.x (use io.github.resilience4j:resilience4j-spring-boot3)resilience4j-spring-boot2 → Spring Boot 2.xspring-cloud-starter-circuitbreaker-resilience4j → Spring Cloud Circuit Breaker abstractionresilience4j-spring-boot3 for Boot 3.x)Check Java version: Java 17+ enables records for fallback DTOs; Java 8+ supported throughout.
reviewUser asks to review existing Resilience4J config. Check for:
slidingWindowSize, failureRateThreshold, waitDurationInOpenState set explicitly (not defaults)slowCallDurationThreshold and slowCallRateThreshold configured — slow calls should also trip the breakerThrowable param)@CircuitBreaker and @Retry not stacked without fallbackMethod on the outer annotation — will swallow exceptions silentlyignoreExceptions for business errors (e.g. IllegalArgumentException, EntityNotFoundException) — don't retry 4xx errorsRateLimiter uses limitForPeriod appropriate for downstream SLA — not an arbitrary numbermaxConcurrentCalls sized against thread pool or reactive schedulermanagement.endpoints.web.exposure.include=health,circuitbreakers,retries,ratelimitersCircuitBreakerEvent listener — not silent@Retry on @Transactional methods — retries after a rolled-back transaction reopen a new transactioncircuit-breakerUser asks to add a circuit breaker to protect a downstream call.
references/patterns.md → Setup)application.yml — set sliding-window-size, failure-rate-threshold, wait-duration-in-open-state@CircuitBreaker(name = "serviceName", fallbackMethod = "fallback")Throwable parametermanagement.health.circuitbreakers.enabled=trueVersion note:
resilience4j-spring-boot3resilience4j-spring-boot2retryUser asks to add automatic retry for flaky remote calls.
application.yml — max-attempts, wait-duration, exponential-backoff-multiplierignore-exceptions for non-retryable errors (validation errors, 4xx responses)retry-exceptions explicitly (e.g. IOException, TimeoutException)@Retry(name = "serviceName", fallbackMethod = "fallback")retryOnResultPredicate to retry on 5xx, not 4xx@CircuitBreaker — retry fires first, circuit breaker wraps it; set retry.max-attempts lower than circuit breaker sliding-window-sizerate-limiterUser asks to limit how often a method can be called (outgoing rate limiting or incoming API protection).
limit-for-period (requests per window), limit-refresh-period, timeout-duration@RateLimiter(name = "serviceName", fallbackMethod = "fallback")bulkheadUser asks to limit concurrent calls to isolate failures (prevent thread starvation).
Two types — choose based on context:
Configure max-concurrent-calls and max-wait-duration (semaphore) or pool size (thread pool).
Annotate with @Bulkhead(name = "serviceName", type = Bulkhead.Type.SEMAPHORE).
timeoutUser asks to add a timeout to a method.
@TimeLimiter for reactive/async methods (returns CompletableFuture or Flux/Mono)@CircuitBreaker with slowCallDurationThreshold insteadtimeout-duration in application.yml@TimeLimiter requires the method to return CompletableFuture<T> — wrap synchronous calls if neededFor review mode: list findings as [CRITICAL] / [HIGH] / [MEDIUM] / [LOW] with file:line references.
For implementation modes: show exact Maven/Gradle snippet, full application.yml config block, and complete annotated Java example. State minimum Spring Boot version where relevant.