当前位置:网站首页>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
边栏推荐
- 2021 summary and 2022 outlook
- I plan to take part in security work. How about information security engineers and how to prepare for the soft exam?
- 【推薦系統 01】Rechub
- seata 1.3.0 四种模式解决分布式事务(AT、TCC、SAGA、XA)
- P1031 [noip2002 improvement group] average Solitaire
- Get pictures through opencv, change channels and save them
- 简单易修改的弹框组件
- 【STM32】实战3.1—用STM32与TB6600驱动器驱动42步进电机(一)
- IDEA快捷键大全
- ArrayList线程不安全和解决方案
猜你喜欢
Wallhaven壁纸桌面版
[système recommandé 01] rechub
How to successfully pass the senior system architecture designer in the second half of the year?
ArrayList thread insecurity and Solutions
Monai version has been updated to 0.9. See what new functions it has
多线程-异步编排
VR development optimization
软考一般什么时候出成绩呢?在线蹬?
使用Tansformer分割三维腹部多器官--UNETR实战
【亲测可行】error while loading shared libraries的解决方案
随机推荐
CAS mechanism
A simple example of delegate usage
多线程-异步编排
Cmake learning manual
1324: [example 6.6] integer interval
SQL Server 知识汇集9 : 修改数据
“梦想杯”2017 年江苏省信息与未来小学生夏令营 IT 小能手 PK 之程序设计试题
TypeScript 接口继承
Summary of router development knowledge
Schnuka: machine vision positioning technology machine vision positioning principle
Network engineer test questions and answers in May of the first half of 2022
Mendeley--免费的文献管理工具,给论文自动插入参考文献
How to prepare for the advanced soft test (network planning designer)?
ADB utility commands (network package, log, tuning related)
【推荐系统 02】DeepFM、YoutubeDNN、DSSM、MMOE
Use load_ decathlon_ Datalist (Monai) fast loading JSON data
seata 1.3.0 四種模式解决分布式事務(AT、TCC、SAGA、XA)
打算参加安全方面工作,信息安全工程师怎么样,软考考试需要怎么准备?
JSON format query of MySQL
枪出惊龙,众“锁”周之