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
2
votes
0 answers

Get response body from NoFallbackAvailableException in spring cloud circuit breaker resilience4j

I want to call a third party API. I use spring cloud circuit breaker resilience4j. Here is my service class : package ir.co.isc.resilience4jservice.service; import ir.co.isc.resilience4jservice.model.Employee; import…
mahdieh
  • 156
  • 3
  • 13
2
votes
3 answers

Springboot: Implementing throttling

We are writing a brand new spring-boot-2 application in our organization.We are exploring the options how can we implement throttling on top of our api?What are some of the frameworks available to implement throttling with spring boot?Can we use…
Rocky4Ever
  • 828
  • 3
  • 12
  • 35
2
votes
1 answer

Resilience4j returning a CompletableFuture around tried method with parameter

I can't find out how to wrap a synchronous method with Resilience4j so that it returns a CompletableFuture, although this seems to be part of Resilience4j's target area. Especially since the synchronous method I want to wrap can throw an…
Jan
  • 1,032
  • 11
  • 26
2
votes
0 answers

correct way of using resilience4j with WebClient

I am writing a circuitbreaker wrapper which should encapsulate http calls (using Spring WebClient ). All the integration services would call the invokeService() method which in turn calls excecute(). Now, if execute() is successful, fine. If not,…
user10937286
  • 321
  • 1
  • 3
  • 10
2
votes
1 answer

How to add resilience4j retry to a spring boot 2 webclient call?

I'm trying to add retry mechanism to a webclient rest call using resilience4j retry which is not working. The method is only getting called once in case of exception. I'm using spring boot 2 with kotlin. This is the caller GlobalScope.launch { …
dripto
  • 570
  • 1
  • 7
  • 17
2
votes
3 answers

Resilience4J Circuit Breaker to kick-in on specific HTTP status code

I am aware we can use recordExceptions() while building CircuitBreakerConfig to register exceptions on which Circuit Breaker should transition to OPEN state. Code I am using resilience4j-feign to decorate my CircuitBreaker. Would be really helpful…
VHegde
  • 43
  • 1
  • 1
  • 8
2
votes
1 answer

Why Resilience4j circuit breaker does not spin up new threads

I am trying to migrate from Hystrix to Resilience4j and tried the option of configuring resilience4j using annotations (https://resilience4j.readme.io/docs/getting-started-3) which is using resilience4j-spring-boot2 dependency. When I test using…
MSeth
  • 81
  • 7
2
votes
1 answer

resilience4j + spring boot 2 + EndpointAutoConfiguration class not found exception

Resilience4j version: 1.1.0 Java version: 1.8 Spring boot : 2.2.0 I am trying to configure the Resilience4j with spring boot project but getting below class not found org.springframework.boot.SpringApplication: Application run…
Sivanagaiah
  • 153
  • 3
  • 10
2
votes
1 answer

Resilience4j Circuit Breaker property to force open

I can see that I can programmatically set the state to force open like so using the following code: CircuitBreaker Forced Open State But is there a way to set a property to set the state to this immediately when the application starts, so it can be…
perkss
  • 1,037
  • 1
  • 11
  • 37
2
votes
1 answer

Resilience4j max waiting time for a service call

I'm looking through the docs of Resilience4j and I cannot seem to find the configuration for a time limiter. I work in Spring Boot 2 and I use configure the setting in an application.yml. So far it looks like this: resilience4j.circuitbreaker: …
minihulk22
  • 149
  • 3
  • 14
2
votes
1 answer

Integration of Resilience 4j and Prometheus

How to integrate Resilience-4J and Prometheus with micro-services. I have integrated Micro-services with resilience 4j and also with Prometheus . My problem is ,in Prometheus i am not getting any resilience query,only HTTP and other which comes…
2
votes
1 answer

Retry with resilience4j doesn't work with some exceptions

I am using the resilience4j library to retry some code, I have the following code below, I expect it to run 4 times. If I throw IllegalArgumentException it works but if I throw ConnectException it doesn't. object Test extends App { val retryConf…
user3237183
2
votes
1 answer

spring-cloud-circuitbreaker with reactive resilience4j

I am confused with CircuitBreaker using WebClient. When the dependent service is down it, the fallback is not executed. Do I need additional configuration? For the CircuitBreaker using RestTemplate this is working without any further…
Zoltan Altfatter
  • 802
  • 2
  • 11
  • 25
2
votes
1 answer

Is decorated function returned by Retry threadsafe?

I have a class that sends a message to a remote service as shown below. I'm using resilience4j-retry to retry the network call. As the retry instance is thread safe according to the documentation, I'm creating it in the class level and reusing it.…
Thomas
  • 4,119
  • 2
  • 33
  • 49
2
votes
0 answers

Spring WebClient Hystrix or Resilience4j or nothing?

I have an application which make excessive web client calls using Spring WebClient, Do i need to use Hystrix or Resilience4j or use web client( Flux or Mono) in build methods like timeout etc.
S Atah Ahmed Khan
  • 1,313
  • 3
  • 14
  • 22