spring - Spring Cloud 2020.0.0 版本后备方法无效
问题描述
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2020.0.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.33</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2021.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
</dependencies>
@FeignClient(value = "xxx",fallback =xxxxx.class)
Feign 调用另一个微服务的方法。当该微服务未启动时,假设 Netflix-Hystrix 已被移除,Feign 调用将失败而不会触发回退指定的回调方法。
解决方案
推荐阅读
- python - Python & OpenCV:尝试保存视频时出现“错误:(-215) scn == 3 || scn == 4 in function ipp_cvtColor”
- jquery - 淡入/淡出/隐藏/显示 JQuery 的问题
- java - 如何使用for循环连续图像滑块?
- sql - 为大于的值添加一个虚拟列
- youtube-data-api - Youtube API v3 使用 PlaylistItems.list 获取视频
- wix - WIX 服务安装程序
- java - 将 LinkedHashMap 转换为 Object
- javascript - 将分钟(字符串)转换为 ISO 8601 持续时间格式
- c# - 将 Unity NetworkMatch 与 UI 相结合
- angular - HTML5 拖放在 Angular 6 上无法按预期工作