Feign-性能优化

1.日志级别尽量用basic

参考 Feign的使用步骤_m0_47233175的博客-CSDN博客 -5.配置Feign日志(配置文件方式)

2.使用HttpClientOKHttp代替URLConnection

        2.1引入feign-httpClient依赖

<!--httpClient的依赖 -->
<dependency>
    <groupId>io.github.openfeign</groupId>
    <artifactId>feign-httpclient</artifactId>
</dependency>

        2.2配置文件开启httpClient功能,设置连接池参数

feign:
    httpclient:
        enabled: true # 开启feign对HttpClient的支持
        max-connections: 200 # 最大的连接数    
        max-connections-per-route: 50 # 每个路径的最大连接数

猜你喜欢

转载自blog.csdn.net/m0_47233175/article/details/121697672
今日推荐