引入了Hystrix依赖却找不到@HystrixCommand注解

问题引入

今天在按照视频学习Spring Cloud Hystrix时,发现报红说找不到@HystrixCommand注解,pom文件中已经引入了hystrix依赖。

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

解决

上网查阅相关资料后发现需要额外引入依赖hystrix-javanica,在pom文件文件新引入如下依赖即可。

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

 

posted @ 2021-12-30 08:38  南北12345678  阅读(350)  评论(1编辑  收藏  举报