在 SpringCloud 整合熔断器(Hystrix)时,出现找不到@HystrixCommand注解,在 Eureka Discovery Client 中依赖为:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
**经发现@HystrixCommand注解是属于 com.netflix.hystrix.contrib.javanica.annotation 包提供,故需要添加以下依赖:
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-javanica</artifactId>
</dependency>