Spring Cloud: Feign and Http Connection Pooling

喜欢而已 提交于 2019-12-04 13:27:40

问题


Can anyone please tell me if the Spring Cloud Feign Client provides or supports Http Connection Pooling, and if so how to configure settings like pool size? I can't seem to find this in the official documentation. Thank you.


回答1:


From investigation I will try to answer my own question:

Spring Cloud Feign uses Netflix Feign. Netflix Feign in turn creates connections using java.net.HttpURLConnection which makes use of 'persistent connections' but not a connection pool.

It is possible to override the Client, for example using Apache HttpClient instead, and Netflix provide a library for this (feign-httpclient). When using this approach the connection pool size can be set using SystemProperties.

In Spring Cloud Brixton it seems that if Apache HttpClient or OkHttpClient are available (via @ConditionalOnClass) then they are automatically used.



来源:https://stackoverflow.com/questions/36153138/spring-cloud-feign-and-http-connection-pooling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!