Jump to Content
resilience4jGuidesGitHub
HomeGuidesChangelog
GuidesGitHubLog Inresilience4j
Home
Log In

Resilience4j is a fault tolerance library for Java™

Resilience4j is a lightweight fault tolerance library inspired by Netflix Hystrix, but designed for functional programming.
Resilience4j provides higher-order functions (decorators) to enhance any functional interface, lambda expression or method reference with a Circuit Breaker, Rate Limiter, Retry or Bulkhead. You can stack more than one decorator on any functional interface, lambda expression or method reference. The advantage is that you have the choice to select the decorators you need and nothing else.

Supplier<String> supplier = () -> service.sayHelloWorld(param1);

String result = Decorators.ofSupplier(supplier)
  .withBulkhead(Bulkhead.ofDefaults("name"))
  .withCircuitBreaker(CircuitBreaker.ofDefaults("name"))
  .withRetry(Retry.ofDefaults("name"))
  .withFallback(asList(CallNotPermittedException.class, BulkheadFullException.class),  
      throwable -> "Hello from fallback")
  .get()

With Resilience4j you don’t have to go all-in, you can pick what you need.

Get Started
All
Guides
Changelog
Start typing to search…

Getting Started

  • Introduction
  • Comparison to Netflix Hystrix
  • Maven
  • View More…

Core Modules

  • CircuitBreaker
  • Bulkhead
  • RateLimiter
  • View More…

Add-on modules

  • Kotlin
  • Feign

RxJava 2&3

  • Getting Started
  • Examples

Spring Reactor

  • Getting Started
  • Examples

Spring Boot 2&3

  • Getting Started

Micronaut

  • Getting Started

Spring Cloud

  • Getting Started

Metrics

  • Micrometer
  • Grafana

License

  • Apache 2.0