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的启动和初始化

相关推荐
程序猿零零漆4 天前
SpringCloud系列教程:微服务的未来(十八)雪崩问题、服务保护方案、Sentinel快速入门
spring cloud·微服务·sentinel
Forest 森林4 天前
【微服务与分布式实践】探索 Sentinel
sentinel
LUCIAZZZ4 天前
SpringCloudGateWay和Sentinel结合做黑白名单来源控制
sentinel
kerwin_code6 天前
Sentinel 控制台集成 Nacos 实现规则配置双向同步和持久化存储(提供改造后源码)
java·sentinel
kerwin_code8 天前
SpringCloudAlibaba 服务保护 Sentinel 项目集成实践
java·sentinel
ChinaRainbowSea9 天前
10. SpringCloud Alibaba Sentinel 规则持久化部署详细剖析
java·spring·spring cloud·sentinel·负载均衡
等一场春雨9 天前
Alibaba Spring Cloud 十七 Sentinel熔断降级
spring·spring cloud·sentinel
kerwin_code11 天前
SpringCloud Gateway 集成 Sentinel 详解 及实现动态监听Nacos规则配置实时更新流控规则
spring cloud·gateway·sentinel
ps酷教程12 天前
sentinel微服务保护
微服务·架构·sentinel
Icoolkj12 天前
微服务学习-Sentinel 限流保护服务
学习·微服务·sentinel