-
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
Response interceptor is not intercepting response #2503
Comments
The latest version is 13.3; this version actually includes the RedirectionInterceptor and the aroundDecode method does not exist (anymore?): https://github.com/OpenFeign/feign/blob/master/core/src/main/java/feign/ResponseInterceptor.java Your use case should be doable using a custom response interceptor in 13.3. Just return the value you want from Maybe you're including the wrong version? Should be |
Thank you for the response. I mentioned in my original post that we are using version 11.10. Do you know how to handle my use case in that version? I know that we should update to 13.3 -- that work is being tracked separately. We're not ready to do that update right now. |
Ah, okay. I was just confused because you mentioned RedirectionInterceptor from the 13.3 readme, which is not mentioned in the 11.10 readme. I have no experience with the old version so I can not help, sorry. |
Ah, my bad. I've been reading the 13.3 readme. Upon reading the 11.10 readme, I see it does not appear to mention response interception at all. I suspect it isn't officially supported then / fleshed out, even if we're able to add them with |
@mfanegg is correct. You will need to use a version of Feign with interceptor support. |
(version 11.10)
Hey team,
I need to intercept a
409
so that my service sees it as a200
. From what I've scraped from the internet and the docs, you need to overridearoundDecode
, so my simple response interceptor looks something like this:This doesn't actually do anything when I add it to my connector builder with
.responseInterceptor(new MyResponseInterceptor())
. I've tried using debugging and print statements, and it doesn't seem to actually hit my customaroundDecode
at all.What am I doing wrong? Or perhaps I am misunderstanding the purpose of response interceptors?
Also, it would be fantastic if an example of a from-scratch response interceptor was added to the README. The README just tells us that it is possible, and gives us an example of a prebuilt response interceptor (side note, the
RedirectionInterceptor
that the README says Feign includes is not actually included with the package -- auto-import does not resolve it, and I'm unable to find it anywhere in version 11.10)The text was updated successfully, but these errors were encountered: