问题
I'm configuring a sample application using this example: http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance. In this section http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-ribbon it is said that:
Feign already uses Ribbon, so if you are using @FeignClient then this section also applies
Does that mean that @FeignClient uses Hystrix too? Does the call to feign client execute inside hystrix command? if so, what is the proper way to pass hystrix configuration?
There are samples that wrap calls to feign client with @HystrixCommand. Is it a correct way?
回答1:
There is an open ticket to support hystrix with feign. Currently, you need to wrap calls to feign clients with hystrix.
回答2:
please use semaphore isolation:
hystrix:
command:
default:
execution:
isolation:
strategy: SEMAPHORE
来源:https://stackoverflow.com/questions/32482704/does-spring-cloud-feign-client-call-execute-inside-hystrix-command