问题引入
今天在按照视频学习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>