当前位置:网站首页>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
边栏推荐
- 关于U盘数据提示RAW,需要格式化,数据恢复笔记
- SAP sto with billing process and configuration
- Apache Hudi 如何加速传统的批处理模式?
- 《内网安全攻防:渗透测试实战指南》读书笔记(八):权限维持分析及防御
- How to present your digital portfolio: suggestions from creative recruiters
- Quick sort
- Shapley Explanation Networks
- SAP STO With Billing流程与配置
- Protobuf 使用
- SAP self created table log function is enabled
猜你喜欢
STO With Billing 跨公司库存转储退货
Towords Open World Object Detection
关于U盘数据提示RAW,需要格式化,数据恢复笔记
The projection vector of a vector to a plane
SAP GUI安全性
How does Apache Hudi accelerate traditional batch mode?
Three minutes to teach you to use Houdini fluid > > to solve particle fluid droplets
C # control the camera, rotate and drag the observation script (similar to scenes observation mode)
Understanding the Role of Individual Units in a Deep Neural Networks(了解各个卷积核在神经网络中的作用)
內網滲透系列:內網隧道之icmpsh
随机推荐
关于U盘数据提示RAW,需要格式化,数据恢复笔记
Houdini > fluid, rigid body export, learning process notes
Automatically fit single line text into the target rectangle
索引被锁数据无法写入ES问题处理
常用Markdown语法学习
Unityshader Foundation
Expression related to month, year and day in SVG
读取修改resource文件夹下的json文件
Introduction to sap query enhanced development
Unity get real geographic map application terrain notes
内网渗透系列:内网隧道之dns2tcp
VBA调用SAP RFC实现数据读取&写入
String self generated code within a given range
KCD_EXCEL_OLE_TO_INT_CONVERT报错SY-subrc = 2
Chapter IV intangible assets
The problem of exporting excel form with wireframe and internal spacing of form by using web form
SAP自建表log功能开启
一些关于网络安全的好教程或笔记的链接,记录一下
第五章 投资性房地产
Houdini>建筑道路可变,学习过程笔记