-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] - Annotation based Retry After Exception #25
Comments
If you take a look at https://github.com/OpenFeign/feign/blob/master/core/src/main/java/feign/SynchronousMethodHandler.java (notice it's a final class/etc) you'll see that at method That means that all your exception needs to do to get passed to the You can then basically implement whatever you want as that exception and override the Let me know if that answers your question (and if so - please close ;)) Thanks, |
I think so it pretty much ties up what I already had. The problem is that the Here's what I have which works;
I guess the best solution would be to raise an issue on feign itself to get that access opened up a little more. Thanks for the support @saintf |
No prob. I'm now confused as to what it was you were trying to achieve... It isn't clear to me. When do you want to retry and how? |
(hit submit too soon...) The RetryDecoder is an error decoder (just like the annotation-error-decoder is one). Feign only lets you pick one. I'd argue rather than using the RetryDecoder, you'd use this one to generate an exception that consumes the response and sets the retryAfter. I think what you're trying to say is that there's some functionality (decoding the header) that is already written in the RetryDecoder that would wouldn't want to duplicate (specifically, reading the header). I wonder if it makes sense to enhance that functionality to move to either the RetryableException (so that it offers it by consuming the response) or if we perhaps somehow allow for that functionality to exist in the annotation-error-decoder (though that doesn't feel completely like the right place as reading those headers is a more generic task - even if it did offer some extra value for the annotation decoder). Thoughts? |
|
In your README you give an example of RetryAfterCertainTimeException. How does this work with Feign's
RetryableException
? I'm trying to implement aRetryAfterException
that gets automatically retried, but without duplicating Feign'sRetryAfterDecoder
(or putting my exception class in thefeign.codec
package).The text was updated successfully, but these errors were encountered: