-
Notifications
You must be signed in to change notification settings - Fork 791
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
FeignClientFactoryBean does not provide a way to register a ResponseMapper #433
Comments
I think that using this customizer might give you the flexibility that you need Unfortunately it is only available in the 2020.0 milestones at the moment. Maybe you could try the milestone build and let us know if it works for you? Then we can consider backporting it into Hoxton. |
I have actually already backported that to Hoxton: #436. Please let us know if that can solve your issue. |
This looks like it should work! Is there a particular build deployed that I
can use under 2.2.X to pull this in? The latest I've found so far is 2.2.6
and it isn't in there.
Thanks,
Chris
…On Mon, Nov 30, 2020 at 11:58 AM Olga Maciaszek-Sharma < ***@***.***> wrote:
I have actually already backported that to Hoxton: #436
<#436>.
Please let us know if that can solve your issue.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#433 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAU6XMUKDWATTJSC63QBSB3SSPFMXANCNFSM4UBIQS2A>
.
|
@celdridge91190 not yet it will be in Hoxton.SR10 |
The This really needs to be handled in the Also it would be nice if Spring Cloud OpenFeign supplied a As a workaround I currently have this in my /**
* Hack to work around the fact that Spring Cloud OpenFeign does not support any way to set a ResponseMapper.
*/
@Bean
public Decoder decoder(final ResponseMapper responseMapper, final ObjectFactory<HttpMessageConverters> messageConverters) {
// this is the default decoder as per FeignClientsConfiguration#feignDecoder
final Decoder defaultDecoder = new OptionalDecoder(
new ResponseEntityDecoder(new SpringDecoder(messageConverters)));
// here we delegate to the ResponseMapper before calling decode()
return (response, type) -> defaultDecoder.decode(responseMapper.map(response, type), type);
} This essentially replicates what |
Feign provides an interface called
ResponseMapper
which allows you to do processing on a response before it is decoding. This is a useful extension for pre-processing things such as response headers without having to embed logic into your decoder. TheFeignClientFactoryBean
does not allow a mechanism to add one which forces consumers to abandon the auto configured feign client functionality and manually create the Feign client if they choose to take advantage of that feature. This request is simply to optionally allow aResponseMapper
to be exposed and included in the Feign client.The text was updated successfully, but these errors were encountered: