当前位置:网站首页>Kitex 重试机制
Kitex 重试机制
2022-07-07 08:54:00 【wangxiaoming】
Kitex 重试机制
什么时候会重试?
kitex 狂简目前有如下三种重试机制:
- 超时重试
- Backup Request(一段时间内未收到响应,进行重试)
- 连接失败重试
框架目前有三类重试:超时重试、Backup Request,建连失败重试(默认)。其中建连失败是网络层面问题,由于请求未发出,框架会默认重试,业务无需关注。
超时重试
超时异常由于网络抖动,下游负载高或者 GC 等导致 GC 卡顿导致超时。
如何设置重试策略?
异常一般有如下三种:
- 业务自定义异常
- 超时异常
- 非超时框架类异常
业务判断异常一般两种方式
下游抛出的Error
下游返回的错误码
返回Error自定义异常配置方式如下:
RetryWithError(IsErrorRetry)
- 通过
BaseResp
自定义错误码配置
RetryWithResult(IsResultRetry)
- 重试次数配置
重试最大次数,如果超过最大重试次数则停止重试。
WithMaxRetry
边栏推荐
- When do you usually get grades in the soft exam? Online pedaling?
- 关于easyflash v3.3使用过程的记录
- 【安装系统】U盘安装系统教程,使用UltraISO制作U盘启动盘
- 【亲测可行】error while loading shared libraries的解决方案
- Idea shortcut keys
- POJ1821 Fence 题解报告
- Typescript interface inheritance
- How to successfully pass the senior system architecture designer in the second half of the year?
- 在线硬核工具
- Arduino board description
猜你喜欢
使用Tansformer分割三维腹部多器官--UNETR实战
无法打开内核设备“\\.\VMCIDev\VMX”: 操作成功完成。是否在安装 VMware Workstation 后重新引导? 模块“DevicePowerOn”启动失败。 未能启动虚拟机。
“梦想杯”2017 年江苏省信息与未来小学生夏令营 IT 小能手 PK 之程序设计试题
uniCloud
Mpx 插件
Deeply analyze the main contents of erc-4907 agreement and think about the significance of this agreement to NFT market liquidity!
Applet jump to H5, configure business domain name experience tutorial
BUUCTF---Reverse---reverse1
[STM32] actual combat 3.1 - drive 42 stepper motors with STM32 and tb6600 drivers (I)
Mendeley -- a free document management tool that automatically inserts references into papers
随机推荐
深入理解Apache Hudi异步索引机制
SQL Server knowledge gathering 9: modifying data
Using tansformer to segment three-dimensional abdominal multiple organs -- actual battle of unetr
Installation and configuration of slurm resource management and job scheduling system
多线程-异步编排
Unable to open kernel device '\.\vmcidev\vmx': operation completed successfully. Reboot after installing vmware workstation? Module "devicepoweron" failed to start. Failed to start the virtual machine
JS实现链式调用
Unity script visualization about layout code
【推薦系統 01】Rechub
Some online academic report websites and machine learning videos
Qtcreator sets multiple qmake
Compile QT project script with qmake
A simple example of delegate usage
TypeScript 接口继承
路由器开发知识汇总
ThreadLocal is not enough
【实战】霸榜各大医学分割挑战赛的Transformer架构--nnFormer
请问申购新股哪个证券公司开户是最好最安全的
简单易修改的弹框组件
PHP \ newline cannot be output