sentinel原理源码分析系列(二)-动态规则和transport

本文是sentinel原理源码分析系列第二篇,分析两个组件,动态配置和transport

动态规则

Sentinel提供动态规则机制,依赖配置中心,如nacos,zookeeper,组件支持动态配置,模板类型为规则,支持动态规则

上图是动态配置模型

PropertyListener 用户(sentinel的插槽)实现,监听规则变更通知,变更是全量DynamicSentinelProperty 持有PropertyListener,支持多个,规则数据源实现利用自身的发现机制,当规则配置变更,调用DynamicSentinelProperty的updateValue,后者通知监听器

下图是zookeeper规则数据源实现,使用curator监听规则znode的变更

transport

transport是一个嵌入到保护资源内的组件,dashboard通过该组件拉取资源的metrics

server 内置远程服务,有3个实现,netty,socket,web mvc

dispatcher负责识别和分发请求到command处理器,后者实际处理请求,支持用户可实现自身的处理器

心跳功能,通过该功能注册到dashboard,构建机器/app资料库(discovery)

Sentinel提供SentinelApiClient访问transport

NEXT 下一篇介绍sentinel的启动和初始化

相关推荐
小马爱记录3 天前
sentinel规则持久化
java·spring cloud·sentinel
小马爱记录4 天前
Sentinel微服务保护
spring cloud·微服务·架构·sentinel
爱编程的张同学7 天前
OpenFeign和Gateway集成Sentinel实现服务降级
spring cloud·sentinel
运维老曾7 天前
Redis-6.2.9 Sentinel 哨兵配置
redis·sentinel
曼彻斯特的海边7 天前
spring-cloud-alibaba-sentinel-gateway
gateway·sentinel·springcloud
xujinwei_gingko7 天前
微服务-Sentinel
微服务·sentinel
_r0bin_12 天前
Sentinel
sentinel
LL小蜗牛12 天前
Alibaba Sentinel 入门教程:从理论到实战
sentinel
飞飞98712 天前
spring sentinel
java·spring·sentinel
cui_hao_nan12 天前
Sentinel限流熔断机制实战
java·sentinel