-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add ResponseInterceptor support #1610
Conversation
CC @velo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you run mvn license:format
and get the build to pass before I can take a look.
Add the license header. Co-authored-by: Dewald de Jager <DewaldDeJager@users.noreply.github.com>
* @param response | ||
* @return | ||
*/ | ||
void beforeDecode(Response response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thinking if we could/should have a single method only.... may advantage is could be a functional interface. Also, if someone needs to share context between before and after it would be much easier.
We would have something similar to http filters or around aspects... one argument would have a proceed
method that run feign internal code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If make a proceed argument like around aspect, the user need to call the proceed explicitly. It seems like a little confused for user.
May combine the before and after method to one method with two arguments (response and object) and invoke it only after decode, that could be easier to use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is fine, since you are intercepting the call, you need to tell it when to run.
IMHO, that offers much better coding possibilities for anyone using it. Like how to share content from before and after methods....
Aspects work like that, filters work like that, I think we will be fine as long is documented.
I modify the interceptor to have a single method(aroundDecode), please check if it is what you want? @velo |
Any updates on the progress? |
Sorry, no, got distracted with something else, will try to get this done now |
@feiyanke and @misselvexu , I made a few changes to this PR, but sadly I can't push to feiyanke:master Take a look, and please lemme know if that would satisfy you usages |
The requirement of |
Proposal for #1126
Add ResponseInterceptor and call before and after decode method in order to do customized logic.