spring-cloud-netflix icon indicating copy to clipboard operation
spring-cloud-netflix copied to clipboard

RibbonLoadBalancingHttpClient should use ApacheHttpClientFactory

Open sureshkrishnamoorthy opened this issue 8 years ago • 3 comments

@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 )

sureshkrishnamoorthy avatar Mar 14 '18 13:03 sureshkrishnamoorthy

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.

ryanjbaxter avatar Mar 14 '18 14:03 ryanjbaxter

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

ryanjbaxter avatar Mar 20 '18 00:03 ryanjbaxter

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.

spencergibb avatar Oct 01 '18 23:10 spencergibb