nacos-2.2.x-主动推送过程
console 发布配置变更
ConfigController
ConfigOperationService:publishConfig
ConfigInfoPersistService
ConfigChangePublisher:ConfigDataChangeEvent
AsyncNotifyService:onEvent
AsyncRpcTask
DumpService: file-> for self
ConfigClusterRpcClientProxy: for cluster other node
ClusterRpcClientProxy: ConfigChangeClusterSyncRequest
-----> ConfigChangeClusterSyncRequestHandler
DumpService:dump
TaskManager:dumpTaskMgr
ConfigChangeClusterSyncRequestHandler
cosole发布变更后,通知当前节,并同步给集群的其他节点
nacos 节点同步配置变更
ConfigChangeClusterSyncRequestHandler
DumpService
TaskManager:dumpTaskMgr
DumpProcessor
DumpConfigHandler
ConfigCacheService
CacheItem
updateMd5
NotifyCenter: publish LocalDataChangeEvent
节点配置变更后,主动同步给 client
LocalDataChangeEvent
RpcConfigChangeNotifier
ConfigChangeListenContext:获取客户端监听者
getListeners: 根据 groupKey 获取 connectionId 列表
RpcPushService
RpcPushTask
ConnectionManager:getConnection
ConfigChangeNotifyRequest
ConfigChangeBatchListenRequestHandler-clientWorker客户端注册
clientWorker 启动时会通过这个类与服务器通信
ConfigChangeBatchListenRequestHandler:clientWorker客户端注册
ConfigBatchListenRequest
ConfigChangeListenContext: 维护 groupKey 和 connnectionId 关系
addListen
ConfigCacheService
isUptodate: 比对请求中的 md5 和 服务器中配置md5是否一样
getContentMd5
CacheItem: 比较服务器中CacheItem中的md5和请求中md5是否一致,返回变化的dataId