Open mfanegg opened 2 months ago
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 intercept
in case of your 409 status or call chain.next(invocationContext)
if you don't want to handle the response code. You can register multiple interceptors into one feign builder.
Maybe you're including the wrong version? Should be io.github.openfeign:<component>:13.3
: https://mvnrepository.com/search?q=io.github.openfeign
@derklaro
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 responseInterceptor
.
@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)