RibbonLoadBalancingHttpClient should use ApacheHttpClientFactory
@spencergibb
@ryanjbaxter
This is with reference to the closed issue How to disable request decompression forwarded to downstream systems #2389
and stackoverflow question https://stackoverflow.com/questions/46736324/zuul-ribbonroutingfilter-content-encoding-gzip-response
Noticed that in RibbonLoadBalancingHttpClient the http client is not created based on DefaultApacheHttpClientFactory (in createDelegate method). Also it doesn't call the disableContentCompression method to disable decompression.
Is there any specific reason why we have two different http client configuration for SimpleHostRoutingFilter and RibbonRoutingFilter ?
If not please let us know how to disable auto decompression for service id based routing for (ie RibbonRoutingFilter -> RibbonLoadBalancingHttpClient )
Good question, looks like an oversight, we should have it use ApacheHttpClientFactory. You can customize the client creation by providing a bean of type AbstractLoadBalancerAwareClient and implementing your own createDelegate method.
Actually I dont think this is an issue.
When we create the RibbonLoadBalancingHttpClient we use the constructor in which we provide the HttpClient (which is created from an instance of ApacheHttpClientFactory). In AbstractLoadBalancingClient we dont call createDelegate because the HttpClient is provided.
https://github.com/spring-cloud/spring-cloud-netflix/blob/1.4.x/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/apache/HttpClientRibbonConfiguration.java#L142
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.