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
4
votes
4 answers

Configure specific breaker for route with Resilience4j in Spring cloud gateway

I attempt to configure Resilience4j in my spring cloud gateway without success. All that I find is for Hystrix or with pure java. I have configured the gateway to transfer request on my service, that is ok. But impossible to configure resilience4j…
Jeremy Caillié
  • 101
  • 2
  • 11
4
votes
1 answer

Use Annotation with Spring Cloud Circuit Breaker - Resilience4j

Is it possible to use Resilience4j on Spring Cloud Circuit Breaker by annotation? I can't find any documentation about it but only examples about using resilience4j by code
Ant
  • 95
  • 1
  • 7
3
votes
1 answer

Micronaut Resilience4j RateLimiter Bean Injection Error

I am trying to experiment with Resilience4j and Micronaut. When making a simple cURL request (curl -X "GET" -L "http://localhost:8080/api/example"), I receive the following error: 09:06:27.228 [default-nioEventLoopGroup-1-3] ERROR…
JavaStan
  • 59
  • 6
3
votes
1 answer

How to get and set authorization token for calls when Circuit Breaker is enabled?

When I turn Circuit Breaker on I'm getting authentication problems from my services, because authorization token is not present in headers of request. I found in the web that Circuit Breaker runs on secondary thread, that doesn't has spring security…
Bruno Freitas
  • 321
  • 3
  • 13
3
votes
0 answers

how to use circuit breaker and caching in microservice

I'm working on a micro service where I have to aggregate data from multiple apis and expose them as a single api output.I'm using spring boot and I want to use circuit breaker like Resilience4j and Redis caching. is it possible to use them together…
user3396478
  • 176
  • 2
  • 13
3
votes
2 answers

Resilience4j Not Ignoring Exceptions

JobServiceImpl.java: @CircuitBreaker(name = "jobsApiServiceGetAllJobs", fallbackMethod = "getAllJobsFallback") public ResponseEntity getAllJobs() { ... throw new ApiException(); } public ResponseEntity
Arshad Yusuf
  • 519
  • 1
  • 5
  • 11
3
votes
2 answers

Resilience4j Circuit Breaker is not working

I am facing a issue with the circuit breaker implementation using Spring Cloud Resilience4j. Following some tutorial, I have tried to add the necessary dependencies in the project. Also, tried to add the configurations but, still the circuit is not…
3
votes
0 answers

Rate limiting WebCient requests after certain number of retries?

Is it possible to rate limit webclient requests for a url or any requests after a defined number of retries using resilience4j or otherwise? Following is a sample code. webClient.post() .bodyValue(...) .header(...) …
3
votes
1 answer

Unable to get resilience4j retry annotation to execute in Springboot unit test

I'm trying to write a unit test to validate my resilience4j app with the @retry annotation, but it's not retrying at all. The code works when I run it, just can't get it unit tested.. Any…
Ryan
  • 1,102
  • 1
  • 15
  • 30
3
votes
1 answer

Translate resilience4j @TimeLimiter annotation to code

What does the @TimeLimiter annotation exactly? Example @TimeLimiter(name = "abc123") public CompletableFuture execute(Supplier supplier) { return CompletableFuture.supplyAsync(supplier); } Could be equal to: public…
Adam
  • 2,845
  • 2
  • 32
  • 46
3
votes
2 answers

Kafka Consumer with Circuit Breaker, Retry Patterns using Resilience4j

I need some help in understanding how I can come up with a solution using Spring boot, Kafka, Resilence4J to achieve a microservice call from my Kafka Consumer. Let's say if the Microservice is down then I need to notify my Kafka consumer using a…
3
votes
3 answers

NoSuchMethodException in resilience4j fallback with spring boot

I am new to this circuit breaking technology. I tried to implement this technology with eureka server but get stuck at this fallback method point. my pom.xml
3
votes
3 answers

Actuator endpoints returns "circuitBreakers":{"status":"UNKNOWN"} despite management.health.circuitbreakers.enabled: true

I have a Spring Boot 2.6.0-M1 project with Jubilee (But issue can be reproduced since 2.4). In my project, I am using Actuator, Spring cloud Kubernetes, and Resilience4J (not Spring Cloud Circuit breaker) Very happy about this combination.…
PatPanda
  • 3,644
  • 9
  • 58
  • 154
3
votes
1 answer

Testing SpringBoot with annotation-style Resilience4j

I'm using annotation-style Resilience4j with my SpringBoot app called "demo". When calling an external backend via RestTemplate I want to use TimeLimiter and Retry to achieve the following: Limit the REST-call duration to 5 seconds --> if it takes…
Sidekick.John
  • 183
  • 3
  • 14
3
votes
1 answer

How to configure to events in Resilience4j Spring starter

I have configured by resilience4j circuitbreaker factory bean like below.But i couldnot get a function to ovveride event listeners example to open , close etc .Please help @Bean public Customizer
1 2
3
22 23