【问题标题】:spring cloud feign hystrix fallback not workspring cloud feign hystrix fallback 不起作用
【发布时间】:2017-08-22 15:36:31
【问题描述】:

与 Spring Boot 版本 1.3.8.RELEASE 和云版本“Brixton.SR”相同的代码可以正常工作。 但“1.5.2.RELEASE”和“Dalston.RC1”不起作用。

异常

HTTP 状态 500 - 请求处理失败;嵌套异常是 java.lang.RuntimeException:com.netflix.client.ClientException:负载均衡器没有可用于客户端的服务器:math-service

【问题讨论】:

  • 欢迎来到 SO!请阅读this 并编辑您的帖子,以便我们更好地帮助您。
  • 你能提供一个示例项目来证明它不工作吗?

标签: java spring spring-cloud hystrix feign


【解决方案1】:

好的,您可以将以下内容添加到您的 application.properties 中,然后它就可以工作了。

feign.hystrix.enabled=true

参见Dalston Release noteDisable HystrixCommands For FeignClients By Default,Feign 客户端默认不再在 Hystrix 命令中包装方法。你必须在 classpath 上有 Hystrix 并且设置 feign.hystrix.enabled=true 让 Feign 在 Hystrix 命令中自动包装方法。

【讨论】:

    猜你喜欢
    • 2017-07-28
    • 2018-03-07
    • 1970-01-01
    • 2017-02-22
    • 2018-07-21
    • 2019-04-26
    • 2018-10-05
    • 2015-06-13
    • 2018-02-02
    相关资源
    最近更新 更多