Rate limiting on top of WebFlux retry

660 views Asked by At

Rate limiting on top of WebFlux retry

I want to limit the number of retires from WebFlux. The use case is that if the service to be invoked goes down then i end up retrying for all read timeouts which in-turn creates double the load. I figured out a way to write custom methods for checking the feasibility of retry but that looks to be more of a hack. Is there any cleaner approach to follow for this use case?

1

There are 1 answers

0
Martin Tarjányi On

Based on the question tags, you already figured out what you need: circuit breaker.

Resilience4j circuit breaker has support for Project Reactor: https://resilience4j.readme.io/docs/examples-1#decorate-flowable-with-a-circuitbreaker