SpringCloud找不到HystrixCommand注解


在 SpringCloud 整合熔断器(Hystrix)时,已经在 Eureka Discovery Client 中加了依赖:

<dependency>
   <groupId>org.springframework.cloud</groupId>
   <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>

出现找不到@HystrixCommand注解,

经发现@HystrixCommand注解是属于 com.netflix.hystrix.contrib.javanica.annotation 包提供,故需要添加以下依赖:

<dependency>
   <groupId>com.netflix.hystrix</groupId>
   <artifactId>hystrix-javanica</artifactId>
</dependency>
 

刷新maven即可


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM