-
-
org.springframework.cloud -
spring-cloud-starter-openfeign -
-
-
com.alibaba.cloud -
spring-cloud-starter-alibaba-sentinel -


首先编写一个配置类:

指定加载配置类:
这样所有在其中定义的fallback类都会被加载了。
- feign:
- client:
- config:
- default: # default全局的配置
- loggerLevel: BASIC # 日志级别,BASIC就是基本的请求和响应信息
- httpclient:
- enabled: true # 开启feign对HttpClient的支持
- max-connections: 200 # 最大的连接数
- max-connections-per-route: 50 # 每个路径的最大连接数
- sentinel:
- enabled: true # 开启降级