Closed KouShenhai closed 1 year ago
说明:okhttp发出的请求可以共享连接,多个请求较httpclient好一点,httpclient单个请求性能比较好,不过需要操心资源回收问题
需要在nacos的application-common.yaml文件里面修改openfeign的配置 修改如下: #FeignAutoConfiguration、OkHttpFeignLoadBalancerConfiguration、OkHttpClient#getClient、FeignClientProperties、OptionsFactoryBean#getObject
openfeign: okhttp: enabled: true circuitbreaker: enabled: true httpclient: enabled: false client: config: default: connectTimeout: 120000 #连接超时 readTimeout: 120000 #读取超时
openfeign将httpclient替换为okhttp