乐趣区

关于java:springbootspringcloud-版本升级带来了对feignhystrix使用的思考

spring-boot、spring-cloud、spring-cloud-alibaba 版本升级带来的思考;
1、原版本
<spring-boot.version>2.3.2.RELEASE</spring-boot.version>
<spring-cloud.version>Hoxton.SR6</spring-cloud.version>
<spring-cloud-alibaba.version>2.2.1.RELEASE</spring-cloud-alibaba.version>
降级到
<spring-boot.version>2.4.4</spring-boot.version>
<spring-cloud.version>2020.0.2</spring-cloud.version>
<spring-cloud-alibaba.version>2020.0.RC1</spring-cloud-alibaba.version>
2、因为 spring-cloud-starter-openfeign 版本号未做对立治理还是应用的“2.2.2.RELEASE”,
应用的还是“feign.hystrix.FallbackFactory”,在服务利用调用时提醒找不到 feign/hystrix/FallbackFactory, 找了好一会才想到 spring-cloud-starter-openfeign 降级到 ”3.0.2″, 导入 org.springframework.cloud.openfeign.FallbackFactory;
class path resource [feign/hystrix/FallbackFactory.class] cannot be opened because it does not exist
3、顺便查了一下两者的实现区别:
import feign.hystrix.FallbackFactory;
import org.springframework.cloud.openfeign.FallbackFactory;

退出移动版