当前位置:网站首页>服务降级的实现
服务降级的实现
2022-04-23 21:57:00 【Leon_Jinhai_Sun】
# 服务降级: 站在系统整体负荷角度 实现: 关闭系统中某些边缘服务 保证系统核心服务运行
Emps 核心服务 Depts 边缘服务
# 1.客户端openfeign + hystrix实现服务降级实现
- 引入hystrix依赖
- 配置文件开启feign支持hystrix
- 在feign客户端调用加入fallback指定降级处理
- 开发降级处理方法
# 2.开启openfeign支持服务降级
feign.hystrix.enabled=true #开启openfeign支持降级
# 3.在openfeign客户端中加如Hystrix
@FeignClient(value = "PRODUCTS",fallback = ProductFallBack.class)
public interface ProductClient {
@GetMapping("/product/hystrix")
String testHystrix(@RequestParam("name") String name);
}
# 4.开发fallback处理类
public class ProductFallBack implements ProductClient {
@Override
public String testHystrix(String name) {
return "我是客户端的Hystrix服务实现!!!";
}
}
版权声明
本文为[Leon_Jinhai_Sun]所创,转载请带上原文链接,感谢
https://blog.csdn.net/leon_jinhai_sun/article/details/124359858
边栏推荐
- CVPR2022 | 基于知识蒸馏的高效预训练
- Cancel the default open project setting of idea
- C#,打印漂亮的贝尔三角形(Bell Triangle)的源程序
- 2.整理华子面经--2
- [leetcode refers to the maximum profit of offer 63. Stock (medium)]
- MySQL 回表
- Pytorch selects the first k maximum (minimum) values and their indexes in the data
- Database Experiment 2 data query
- How to play the guiding role of testing strategy
猜你喜欢
C, print the source program of beautiful bell triangle
Database experiment VI integrity language experiment
Plato Farm元宇宙IEO上线四大,链上交易颇高
Echerts add pie chart random color
[leetcode refers to offer 47. Maximum value of gift (medium)]
Resolve the "chromedriver executable needs to be in path" error
How to make Jenkins job run automatically after startup
Yolov5 NMS source code understanding
Common scenes of vector product in image
Subcontracting of wechat applet based on uni app
随机推荐
Ubutnu20 installer centernet
[leetcode refers to offer 52. The first common node of two linked lists (simple)]
[leetcode sword finger offer 28. Symmetric binary tree (simple)]
Database Experiment 2 data query
Ali has another "against the sky" container framework! This kubernetes advanced manual is too complete
在线Excel转CSV工具
清华大学 | WebFace260M:百万级深度人脸识别的基准(TPAMI2022)
C# ftpHelper
thinkphp5+数据大屏展示效果
Sklearn function: Train_ Test_ Split (split training set and test set)
Pyuninstaller package exe cannot find the source code when running, function error oserror: could not get source code
MySQL back to table
Sharpness difference (SD) calculation method of image reconstruction and generation domain index
Plato Farm元宇宙IEO上线四大,链上交易颇高
Problem brushing plan -- dynamic programming (IV)
Amazon and epic will be settled, and the Microsoft application mall will be opened to third parties
Idea import a project
Normalized transforms in pytorch The real calculation process of normalize
ubutnu20安装CenterNet