Resilience4j is a fault tolerance library for Java™

Resilience4j is a lightweight fault tolerance library inspired by Netflix Hystrix, but designed for functional programming. Lightweight, because the library only uses Vavr, which does not have any other external library dependencies. Netflix Hystrix, in contrast, has a compile dependency to Archaius which has many more external library dependencies such as Guava and Apache Commons Configuration.

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 = () -> backendService.doSomething(param1, param2);

Supplier<String> decoratedSupplier = Decorators.ofSupplier(supplier)

String result = Try.ofSupplier(decoratedSupplier)
  .recover(throwable -> "Hello from Recovery").get();

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

Get Started

Getting Started

Getting started with resilience4j-reactor

Resilience4j provides a module with custom Spring Reactor operators. The operators make sure that a downstream subscriber can acquire a permission to subscribe to an upstream Publisher. The reative types Mono and Flux are supported.

The module expects that io.projectreactor:reactor-core is already provided at runtime. Spring Reactor is not a transitive dependency.

repositories {

dependencies {
  compile "io.github.resilience4j:resilience4j-reactor:${resilience4jVersion}"

Getting Started

Getting started with resilience4j-reactor

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.