简体   繁体   中英

spring cloud feign hystrix fallback not work

same code with spring boot version 1.3.8.RELEASE and cloud version 'Brixton.SR' works right. but '1.5.2.RELEASE' and 'Dalston.RC1' not work.

exception

HTTP Status 500 - Request processing failed; nested exception is java.lang.RuntimeException: com.netflix.client.ClientException: Load balancer does not have available server for client: math-service

OK, you can add the following to your application.properties, then it works.

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 . You must have Hystrix on the classpath and also set feign.hystrix.enabled=true to have Feign automatically wrap methods in Hystrix commands.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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