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