Spring cloud中整合Hystrix时,无法识别@HystrixCommand标签,项目的Hystrix依赖为:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
查了一下,@HystrixCommand注解是由名为javanica的Hystrix contrib库提供的。javanica是一个Hystrix的子项目,用于简化Hystrix的使用。所以,还需要添加一个依赖:
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-javanica</artifactId>
<version>RELEASE</version>
</dependency>
注:我使用的是Spring Cloud Edgware版本
最后
以上就是兴奋店员最近收集整理的关于找不到@HystrixCommand标签的全部内容,更多相关找不到@HystrixCommand标签内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复