Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 594
chenjiankang Avatar asked Mar 29 '17 08:03

chenjiankang


1 Answers

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.

like image 184
Yue Avatar answered Oct 30 '22 22:10

Yue