当前位置:网站首页>sentinel集成nacos动态更新数据原理
sentinel集成nacos动态更新数据原理
2022-04-23 06:32:00 【梦江河梦】
1)动态数据源顶层接口
- loadConfig方法:返回目标数据,应该就是sentinel需要的各种规则对象;
- readSource方法:返回源数据,一般是字符串类型或者byte类型,然后解析成上面的目标数据类型,可推断出这个方法是实现的重点;
- getProperty方法:获取与当前数据源绑定的SentinelProperty,可以看出与目标数据有关;
- 总结:整个流程是2->1->3的顺序
2)顶层抽象类
包含一个数据转换器,将源数据转换成目标数据,和SentinelProperty的实现类DynamicSentinelProperty
3)Nacos数据源、重写的readSource方法、初始化数据
- 根据nacos配置中心的API返回源数据;
- 调用getProperty().updateValue(newValue)更新数据;
4)SentinelProperty顶层接口
- updateValue方法是重点,会一一通知PropertyListener更新数据,调用PropertyListener的configLoad方法;
- addListener时会调用PropertyListener的configUpdate方法;
5)关于流控规则的FlowPropertyListener
6)sentinel的流控处理器FlowSlot
- 最终会调用FlowRuleManager的getRules方法获取流控规则,FlowRuleManager内部类FlowPropertyListener正是PropertyListener接口的实现类,这下把整个流程都串联起来了
版权声明
本文为[梦江河梦]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_42002747/article/details/120916979
边栏推荐
- 05 use of array
- Intranet penetration series: icmpsh of Intranet tunnel
- [NLP notes] preliminary study on CRF principle
- SAP自建表log功能开启
- 一些关于网络安全的好教程或笔记的链接,记录一下
- Chapter IV intangible assets
- Unity ugui determines the solution of clicking on the UI and 3D objects
- C problem of marking the position of polygons surrounded by multiple rectangles
- Link to some good tutorials or notes about network security and record them
- 内网渗透系列:内网隧道之pingtunnel
猜你喜欢
The displayed amount of ABAP ALV is inconsistent with the exported amount
Mysql database backup and recovery under Linux (full + incremental)
Understanding the Role of Individual Units in a Deep Neural Networks(了解各个卷积核在神经网络中的作用)
Teach-Repeat-Replan: A Complete and Robust System for Aggressive Flight in Complex Environments
Simplify exporting to SVG data files and all images in SVG folder
VBA appelle SAP RFC pour réaliser la lecture et l'écriture des données
Shapley Explanation Networks
Unity get real geographic map application terrain notes
Plane definition - plane equation
Houdini流体>>粒子流体导出到unity笔记
随机推荐
Electronic builder package error: proxyconnect TCP: Dial TCP: 0: connectex
C operation registry full introduction
如何展示您的数字作品集:来自创意招聘人员的建议
从零开始完整学习机器学习和深度学习,包括理论和代码实现,主要用到scikit和MXNet,还有一些实践(kaggle上的)
C SVG path parser of xamarin version
Index locked data cannot be written to es problem handling
One of event management
内网渗透系列:内网隧道之dns2tcp
Protobuf use
Expression related to month, year and day in SVG
一文了解系列,对web渗透的常见漏洞总结(持续更新)
Idea shortcut
webflux文件上传下载
VBA calls SAP RFC to read & write data
TA notes of Zhuang understand (zero) < bedding and learning methods >
Personality charm of high paid it workers
Dictionary & lt; T1,T2&gt; Sorting problem
A series of articles, a summary of common vulnerabilities of Web penetration (continuously updated)
Reading notes
Internal network security attack and defense: a practical guide to penetration testing (8): Authority maintenance analysis and defense