简体   繁体   English

春云假装hystrix后退不起作用

[英]spring cloud feign hystrix fallback not work

same code with spring boot version 1.3.8.RELEASE and cloud version 'Brixton.SR' works right. 与Spring引导版本1.3.8.RELEASE相同的代码和云版本'Brixton.SR'正常工作。 but '1.5.2.RELEASE' and 'Dalston.RC1' not work. 但是'1.5.2.RELEASE'和'Dalston.RC1'不起作用。

exception 例外

HTTP Status 500 - Request processing failed; HTTP状态500 - 请求处理失败; nested exception is java.lang.RuntimeException: com.netflix.client.ClientException: Load balancer does not have available server for client: math-service 嵌套异常是java.lang.RuntimeException:com.netflix.client.ClientException:负载均衡器没有客户端的可用服务器:math-service

OK, you can add the following to your application.properties, then it works. 好的,您可以将以下内容添加到您的application.properties中,然后就可以了。

feign.hystrix.enabled=true

See Dalston Release note and Disable HystrixCommands For FeignClients By Default , Feign clients no longer wrap methods in Hystrix commands by default . 请参阅Dalston发行说明禁用HystrixCommands对于FeignClients默认情况下,默认情况下,Feign客户端不再在Hystrix命令中包装方法。 You must have Hystrix on the classpath and also set feign.hystrix.enabled=true to have Feign automatically wrap methods in Hystrix commands. 您必须在类路径上使用Hystrix,并设置feign.hystrix.enabled = true以使Feign在Hystrix命令中自动换行方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM