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
1 answer

Resilience4j Retry module in Spring Cloud Circuitbreaker

I'm trying to migrate my Spring Boot 2 Resilience4j implementation to the one provided by Spring Cloud Circuitbreaker. So basically, from resilience4j-spring-boot2 + resilience4j-reactor dependencies to…
2
votes
2 answers

Using resilience4j to rate limit based on API Key

I'm building an Java REST API that requires clients to use api keys in order to access. I want to implement rate limiting based on the API key, so that a single api cannot use the api too many times within a given timeframe. I'm been looking to…
metalhead696
  • 195
  • 2
  • 11
2
votes
3 answers

CircuitBreaker immediate fallback

I followed https://resilience4j.readme.io/docs/getting-started-3 for Resilience4J documentation. I have a problem, my circuitbreaker is immediately connecting to the fallback( on the first invoke) when the primary-backend is not…
Winster
  • 943
  • 10
  • 28
2
votes
1 answer

How to use Resilience4j Circuit Breaker with WebFlux in Spring Boot

I have service A that calls downstream service B. Service A code @RestController @RequestMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE) public class GreetingController { private final GreetingService greetingService; …
2
votes
0 answers

How to use Resilience4j Time limiter for synchronous Request

I used Resilience4j API to implement timelimiter functionality for my application But it will accept return type only CompletableFuture, Mono, FLux (non blocking queue) So how to use for ResponseEntity OR any Return type can accept, which mean i…
2
votes
0 answers

Fallback to another route in Spring Cloud Gateway if circuit breaker opens

I have routes of this kind. They work fine, but for some reason an error appears in the logs (the last line of the logs). This is due to the fact that the response tries to pass through the filter modifyResponseBody a second time. Why is this…
Skrra dev
  • 21
  • 2
2
votes
2 answers

Resilience4j rate limiter is not working properly in project reactor?

I'm currently researching the resilience4j library and for some reason the following code doesn't work as expected: @Test public void testRateLimiterProjectReactor() { // The configuration below will allow 2 requests per second and a "timeout"…
tftd
  • 16,203
  • 11
  • 62
  • 106
2
votes
0 answers

Resilience4j vs Sentinel

We are looking to replace Hystrix with Resilience4j or Sentinel. I am looking for advice on which one should be preferred. I have spent some time searching on google but could find any clear conclusion. Both libraries have their own features. We…
amique
  • 2,176
  • 7
  • 34
  • 53
2
votes
1 answer

implement throttling/debouncing using resilience4j

My question is how to implement (configure) throttlig using resilience4j library. I tried to use RateLimiter with next configuration: RateLimiter rateLimiter = RateLimiterRegistry.of( RateLimiterConfig.custom() …
Anatoly
  • 79
  • 1
  • 5
2
votes
0 answers

How to correctly configure resilience 4J fall back client with annotations?

As the title suggests, below is a class that hooks to a Euereka registry as per YAML configs, and looks for a nonexistent client fallback-test URL. @FeignClient(name = "fallback-test", configuration =…
Soham
  • 671
  • 1
  • 7
  • 23
2
votes
0 answers

Webflux and Resilience4j retry issue

wanted to ask a basic question about webflux and resilience4j's retry. We are running Java SpringBoot with Webflux and Resilience4J (not Spring Cloud Circuit Breaker). While running the application its giving error (Somehow full stack trace is not…
2
votes
1 answer

Get Instance of circuit breaker from configuration file

This is my configuration file. resilience4j.circuitbreaker: instances: backendB: registerHealthIndicator: true slidingWindowSize: 10 minimumNumberOfCalls: 10 permittedNumberOfCallsInHalfOpenState: 3 …
2
votes
1 answer

What's the purpose of applying the Bulkhead pattern on a non-blocking application?

My understanding of the Bulkhead pattern is that it's a way of isolating thread pools. Hence, interactions with different services use different thread pools: if the same thread pool is shared, one service timing out constantly might exhaust the…
Rubasace
  • 939
  • 8
  • 18
2
votes
1 answer

Include/exclude exceptions in camel resilience4J

How to include/exclude exceptions from profiling while implementing circuit breaker pattern using resilience4J library in camel route(spring-boot application). we are using the following official library but it doesn't expose any API to include…
2
votes
1 answer

How to integrate Resilience4j metrics to Micrometer in Camel Spring Boot

I am using Camel with Spring Boot and Micrometer. In one of my routes I am using a circuitbreaker with Resilience4j: .circuitBreaker() .resilience4jConfiguration() .timeoutEnabled(true) .timeoutDuration(2000) …