Spring Cloud: Feign and Http Connection Pooling

前端 未结 2 887
忘了有多久
忘了有多久 2021-02-09 00:37

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 fin

2条回答
  •  情歌与酒
    2021-02-09 01:16

    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.

提交回复
热议问题