SpringCloud 配置 feign.hystrix.enabled: true 不生效

SpringCloud 配置 feign.hystrix.enabled: true 不生效的原因

feign 启用 hystrix

feign 默认没有启用 hystrix,添加配置,启用 hystrix

feign.hystrix.enabled=true

application.yml 添加配置

bash 复制代码
feign:
  hystrix:
    enabled: true

启用 hystrix 后,访问服务,未发生降级

解决办法:

feign.hystrix.enabled: true 是老版本的配置, 新版的配置是

bash 复制代码
feign:
  circuitbreaker:
    enabled: true

修改之后,配置生效

pom文件依赖版本

bash 复制代码
 <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
            <version>2.2.9.RELEASE</version>
        </dependency>
相关推荐
蓝瑟柳絮14 分钟前
学习之什么是生成器
android·java·学习
Katharine_Yuan44 分钟前
JVM内存模型
java·jvm·算法
技术无疆44 分钟前
【Python】The Algorithms:开源算法的宝库
java·c语言·开发语言·c++·python·算法·开源
Teln_小凯1 小时前
nodejs - puppeteer 无头浏览器截图 JAVA后端调用
java·前端·python
小码农<^_^>1 小时前
c/c++内存管理
java·c语言·c++
费曼乐园2 小时前
Spring中如何为静态变量注入值
java·spring
搁浅°8792 小时前
spring第一个入门框架
java·后端·spring
@sinner2 小时前
【Spring Boot 入门一】构建你的第一个Spring Boot应用
java·spring boot·后端
山语山2 小时前
【Java】酒店管理系统
java·开发语言·数据库架构·visual studio