From 6c05ad54970842897a154b5dcdd39cbf98abfe11 Mon Sep 17 00:00:00 2001 From: HMYDK Date: Mon, 15 Jul 2024 14:13:43 +0800 Subject: [PATCH] [ISSUE #12282]Fix the issue where monitoring data cannot be found through the IP dimension in the ListeningQuery (#12315) --- .../config/server/service/ConfigSubService.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/ConfigSubService.java b/config/src/main/java/com/alibaba/nacos/config/server/service/ConfigSubService.java index 31b2a2c92..ebf7afabb 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/ConfigSubService.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/ConfigSubService.java @@ -83,6 +83,11 @@ public class ConfigSubService { return new ClusterListenerJob(params, completionService, memberManager).runJobs(); } + private List runConfigListenerByIpCollectionJob(Map params, + CompletionService completionService) { + return new ClusterListenerByIpJob(params, completionService, memberManager).runJobs(); + } + static class ClusterListenerJob extends ClusterJob { static final String URL = Constants.COMMUNICATION_CONTROLLER_PATH + "/configWatchers"; @@ -93,6 +98,16 @@ public class ConfigSubService { } } + static class ClusterListenerByIpJob extends ClusterJob { + + static final String URL = Constants.COMMUNICATION_CONTROLLER_PATH + "/watcherConfigs"; + + ClusterListenerByIpJob(Map params, CompletionService completionService, + ServerMemberManager serverMemberManager) { + super(URL, params, completionService, serverMemberManager); + } + } + private List runHasCheckListenerCollectionJob(Map params, CompletionService completionService) { return new ClusterCheckHasListenerJob(params, completionService, memberManager).runJobs(); @@ -324,7 +339,7 @@ public class ConfigSubService { SampleResult sampleCollectResult = new SampleResult(); for (int i = 0; i < sampleTime; i++) { - List sampleResults = runConfigListenerCollectionJob(params, completionService); + List sampleResults = runConfigListenerByIpCollectionJob(params, completionService); if (sampleResults != null) { sampleCollectResult = mergeSampleResult(sampleCollectResult, sampleResults); }