引入了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>
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步