Open jhalterman opened 5 years ago
- More Policy implementations including Bulkhead, RateLimiter, and Cache
What about backup requests or hedged requests?
@whiskeysierra Do you have another pointer for backup requests?
I suspect both of these would be specific to Http or other client/server technologies. Do you think there's a way to write policies for these in a way that's not specific to particular technologies and external dependencies?
Technically it's just a different flavor of retries. Retries right now are triggered by exceptions (or unacceptable results) while backup requests are somewhat like an early retry caused by latency/delay. Can apply to anything, not just HTTP.
Thanks - so to be clear, Riptide's backup requests are the same pattern as hedged requests?
Yes, backup requests and hedged requests are the same thing. Just different names.
Can you add a succeed on a Throwable? So that it keeps retrying if there is no exception and succeeds when you get a particular exception.
@gelpenaddict Yea, by default throwables are handled (treated as failures) but you can override that via handleIf
to specify that you want to "handle" (retry) on certain results, else not (which means failures/exceptions will not be retried). Ex:
retryPolicy.handleIf((result, failure) -> result == someBadValue)
Not a Contribution.
Not sure if I understand backup requests correctly, so I'm describing a behaviour that would be nice to have in my case:
Backup request is a bit different from a hedged one. It's more similar to an existing Fallback policy, but it starts its execution immediately, in parallel to the main request. Its results are only used when the main request fails. It may also need some retries/circuit breakers/fallbacks configured.
This is good for gradual service degradation where I can use a different and much less heavy request as a backup to the main request that may not be able to finish in time.
@timothybasanov Can you open an issue for backup requests?
This issue sketches out some of the past and future roadmap for Failsafe, and will be updated over time. Feel free to comment with suggestions.
3.x
3.2
3.1
3.0
2.2:
For 2.0: