Reputation: 19
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?
Upvotes: 0
Views: 862
Reputation: 9987
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
Upvotes: 0