前言
feign默认使用urlConnection,没有连接池

一、加依赖
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
</dependency>
二、改yml
feign:
client:
config:
default: #全局
loggerLevel: full
httpclient:
#让feign使用httpclient做请求;而不是urlConnection
enabled: true
#feign的最大链接数
max-connections: 200
#fegin的单个路径最大连接数
max-connections-per-route: 50
本文介绍了如何通过引入feign-httpclient依赖并修改YML配置,将Feign默认的URLConnection替换为HttpClient,同时设置最大连接数和每个路径的最大连接数,以此实现Feign客户端性能提升15%的方法。
373

被折叠的 条评论
为什么被折叠?



