OpenFeign默认使用的jdk中的urlconnection,如何替换成httpclient?

提问者:帅平 问题分类:微服务
OpenFeign默认使用的jdk中的urlconnection,没有连接池,性能极低,如何替换成httpclient?
1 个回答
影子爱人
影子爱人
把默认的urlconnection替换成httpclient的话,只需要配置即可,下面演示下操作步骤:
1、在配置文件中新增:
feign.httpclient.enabled=true

2、在maven的pom里面引入
<dependency>
    <groupId>io.github.openfeign</groupId>
    <artifactId>feign-httpclient</artifactId>
    <version>9.3.1</version>
</dependency>
发布于:1年前 (2023-02-13) IP属地:四川省
我来回答