Questions tagged [resilience4j]

Resilience4j is lightweight alternative to Netflix Hystrix.

Resilience4j is a lightweight, easy-to-use fault tolerance library inspired by Netflix Hystrix, but designed for Java 8 and functional programming. Lightweight, because the library only uses Vavr (formerly Javaslang), 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. With Resilience4j you don’t have to go all-in, you can pick what you need.

Resilience provides several core modules and add-on modules:

Core modules:

resilience4j-circuitbreaker: Circuit breaking

resilience4j-ratelimiter: Rate limiting

resilience4j-bulkhead: Bulkheading

resilience4j-retry: Automatic retrying (sync and async)

resilience4j-cache: Response caching

resilience4j-timelimiter: Timeout handling

Add-on modules

resilience4j-metrics: Dropwizard Metrics exporter

resilience4j-prometheus: Prometheus Metrics exporter

resilience4j-spring-boot: Spring Boot Starter

resilience4j-ratpack: Ratpack Starter

resilience4j-retrofit: Retrofit Call Adapter Factories

resilience4j-vertx: Vertx Future decorator

resilience4j-consumer: Circular Buffer Event consumer
336 questions
5
votes
1 answer

How to combine CircuitBreaker with TimeLimiter and Bulkhead?

I have a service that calls a dependency via REST. Service and dependency are part of a microservice architecture, so I'd like to use resilience patterns. My goals are: Have a circuit-breaker to protect the dependency when it's struggling Limit the…
fafl
  • 7,222
  • 3
  • 27
  • 50
5
votes
2 answers

Getting compatible version issue when running spring boot application however in pom there is only version

Application is not starting however I only have added one version of resilience4j io.github.resilience4j resilience4j-spring-boot2
Smit
  • 2,078
  • 2
  • 17
  • 40
5
votes
1 answer

Migrate HystrixCommands to Resilience4j

Given Hystrix going into mainentance mode, I've been working on migrating a (rather large) codebase to Resilience4j. I make heavy use of the following pattern with Hystrix: new HystrixCommand(DependencyKeys.DEPENDENCY) { …
Ben Smith
  • 1,554
  • 1
  • 15
  • 26
4
votes
1 answer

Resilience4J for Springboot - what is the use of registerHealthIndicator: true

In Resilience4J for spring boot what is the use of registerHealthIndicator: true ? The document https://resilience4j.readme.io/docs/getting-started-3#health-endpoint says if we configure as below in application.yml we can see the status of circuit…
Deedai
  • 125
  • 1
  • 9
4
votes
0 answers

How to use retryOnResult with spring boot?

Resilience4j version: 1.7.0 Java version: 8 I'm trying to retry a boolean method using Resilience4j if it returns a false. The code is as follows @Retry(name = "redis") public boolean publishMessage(RedisMessageWrapper redisMessage) { try { …
4
votes
1 answer

How's the behaviour of circuit breaker in HALF_OPEN state (resilience4j)

Sometimes I can see a CallNotPermittedException with a message that says the circuit breaker is in HALF_OPEN state. But I don't understand how does it work in that state. I've written a test with a mock server where I have…
alegorth
  • 51
  • 1
  • 3
4
votes
2 answers

Cannot be cast to class org.springframework.cloud.circuitbreaker.resilience4j.Resilience4JCircuitBreaker

I was using Spring Boot 2.4 with Gradle. Here is how I've defined my dependency: compile 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j' It was working fine, but when I add: implementation…
sally
  • 41
  • 3
4
votes
3 answers

Resilience4j Retry - logging retry attempts from client?

Is it possible to log retries attempts on client side with resilience4j please? Maybe via some kind of configuration, or settings. Currently, I am using resilience4j with Spring boot Webflux annotation based. It is working great, the project is…
PatPanda
  • 3,644
  • 9
  • 58
  • 154
4
votes
1 answer

resilience4j-spring-boot-2 annotations (@Retry, @CircuitBreaker...) are completely ignored

I spent a whole day trying to find why this does not work so I think it might be useful if I share the question and the answer. The Resilience4j library provides an elegant annotation-based solution from Spring Boot 2. All you need to do is just…
Honza Zidek
  • 9,204
  • 4
  • 72
  • 118
4
votes
1 answer

Resilience4j Retry+Spring Boot 2 application.yml config not applied

I'm using Resilience4j @Retry combined with @CircuitBreaker. I use annotations in SpringBoot 2 and my configuration is in application.yml. I have a fallback method in the @Retry annotation, but not in the @CircuitBreaker (That's the way to make…
Stadmina
  • 121
  • 1
  • 8
4
votes
2 answers

Decorate function in Resilience4j circuit breaker with parameter

I want to decorate my service call with the newest resilience4j circuit breaker, my current code looks like: @Bean public Function decoratedFunction(MyService myService) { CircuitBreakerRegistry registry =…
Kacper Opyrchał
  • 349
  • 3
  • 13
4
votes
1 answer

How to achieve multiple circuit breakers with same configuration in Resilience4J

I am new to Resilience4J and trying to integrate with Spring boot. My application has several remote system calls. I expect the same circuit breaker configuration for all remote calls. I am using java configuration and functional style of decorating…
swathi manda
  • 101
  • 1
  • 7
4
votes
0 answers

Resilience4j bulkhead Thread behaviour

I am doing a lot of tests using Resilience4j and monitoring the behaviour of threads. I am using spring-boot 2.2.5, resilience4j 1.4.0. Gatling (load tool), visualvm (Analyze thread) I realized that: When I use bulkhead type = SEMAPHORE. I realized…
javaTry
  • 1,085
  • 2
  • 18
  • 30
4
votes
1 answer

Bean Configuration for Circuit Breaker of Resilience4J Using Spring Boot

I want to move my Circuit Breaker Configuration from application.yml file to some config java file as bean declaration beacuse it makes application.yml file to be large, Will it be possible for me to remove the configuration from applciation.yml and…
Monesh
  • 103
  • 2
  • 8
4
votes
2 answers

Integrating circuitbreaker, retry and timelimiter in Resilience4j

I am trying to use Resilience4j features. My use case is to combine the 3 modules: circuitbreaker retry timelimiter I want to combine all these modules and execute the method only once. Code Here is what I have tried. Supplier supplier =…
1
2
3
22 23