关于Dalston.SR3版本的spring cloud,用feign客户端调用服务hystrix不能生效的问题
2017-09-15 14:02
1111 查看
这两天公司让学习spring cloud,我在项目中用的springcloud版本是Dalston.SR3版本。当我在学习用feign客户端做断路器的时候,发现feign客户端并没有降级去调用回调类,而抛出这样的错误。
原因是这个版本的spring cloud是默认关闭Hystrix的断路器功能,解决办法:
如果你的配置文件用的是yml文件,在文件加如下配置:
如果你的配置文件用的是properties文件,在文件加如下配置:
com.netflix.client.ClientException: Load balancer does not have available server for client: hello-service
原因是这个版本的spring cloud是默认关闭Hystrix的断路器功能,解决办法:
如果你的配置文件用的是yml文件,在文件加如下配置:
feign: hystrix: enabled: true
如果你的配置文件用的是properties文件,在文件加如下配置:
feign.hystrix.enabled=true
相关文章推荐
- spring cloud,用feign客户端调用服务hystrix不能生效的问题
- 关于在Spring Cloud Feign工程中使用Hystrix配置不生效的问题
- Spring Cloud Feign作为HTTP客户端调用远程HTTP服务,feign熔断器
- 微服务开发架构——Spring Cloud常见问题与总结<二>Hystrix/Feign 整合Hystrix后首次请求失败
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- 使用Spring cloud Feign在后台服务之间调用传递Multipart无法传递的问题
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- Spring Cloud 入门教程(六): 用声明式REST客户端Feign调用远端HTTP服务
- spring cloud feign 调用服务注意问题
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- spring cloud feign 调用微服务转发不了request请求头和参数问题解决方案
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务的方法(推荐)
- 关于在Spring Cloud Feign工程中使用Ribbon配置不生效的问题
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- Spring Boot使用Feign客户端调用远程服务时出现:timed-out and no fallback available,failed and no fallback available的问题解决
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务