Describe the bug
In our production we want to use retry filter for some of our routes. We need to retry for specific statuses 502 or 503 for example. And if we have in response a status that we didn't specify from 5xx series (like 500), it will retry anyway. This is because 5xx series is default in RetryConfig:
private List<Series> series = toList(Series.SERVER_ERROR);
And because if the code is not retryable code the factory tries series:
if (!retryableStatusCode && statusCode != null) {
retryableStatusCode = retryConfig.getSeries().stream()
.anyMatch(series -> statusCode.series().equals(series));
}
Moreover, if we specified 400 code (for example) in Retry config the filter will also retry on 5xx codes.
I found a solution by specifing series value as null, but it looks like duct tape and temporary solution.
Sample
Here is the sample repository
Doesn't specifying null make sense? You need to tell the config to not include any series. Do you have a better solution in mind?
@ryanjbaxter I think not specifing the series at all makes more sense because it implies that you don't need series to be checked. Yes, I have a solution, check readme of my sample
We are being opinionated here. I think series, in general, makes more sense as a default. If you want specific codes, set the series to null.
We are being opinionated here. I think series, in general, makes more sense as a default. If you want specific codes, set the series to
null.
Can you please add a line in documentation of the filter about that? This is really not obvious solution
Having a specific 400 error like 401 and the 500 series is still valid.
Thank you!