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

相关推荐
u0104058369 小时前
Java中的服务熔断机制:Hystrix与Sentinel的比较
java·hystrix·sentinel
what丶k9 小时前
微服务稳定性守护者:Sentinel 全面使用指南(从入门到企业级落地)
微服务·架构·sentinel
鸽鸽程序猿12 小时前
【JavaEE】【SpringCloud】 熔断和限流 Alibaba Sentinel
spring cloud·java-ee·sentinel
小楼v1 天前
如何使用Sentinel进行流量控制和熔断
java·后端·sentinel
MediaTea4 天前
Python:_sentinel 命名约定
开发语言·python·sentinel
短剑重铸之日4 天前
《SpringCloud实用版》Feign + LoadBalancer + Sentinel 微服务调用链路
spring cloud·微服务·sentinel·feign·loadbalancer
短剑重铸之日4 天前
《SpringCloud实用版》告别 Hystrix!Sentinel vs Resilience4j 深度对比 & 选型
spring cloud·hystrix·sentinel·熔断限流降级
wfsm8 天前
sentinel
sentinel
sunnyday042610 天前
Spring Cloud Alibaba Sentinel 流量控制与熔断降级实战指南
spring boot·sentinel·springcloud
递归尽头是星辰13 天前
Spring Cloud Alibaba 核心理论体系:Nacos、Sentinel、Seata深度解析
spring cloud·nacos·sentinel·seata·微服务治理