diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/ServiceController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/ServiceController.java index aacb94024..198606d04 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/ServiceController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/ServiceController.java @@ -272,8 +272,8 @@ public class ServiceController { return result; } - @RequestMapping("/searchDom") - public JSONObject searchDom(HttpServletRequest request) { + @RequestMapping("/names") + public JSONObject searchService(HttpServletRequest request) { JSONObject result = new JSONObject(); String namespaceId = WebUtils.optional(request, CommonParams.NAMESPACE_ID, @@ -301,7 +301,7 @@ public class ServiceController { @RequestMapping("/serviceStatus") public String serviceStatus(HttpServletRequest request) { //format: dom1@@checksum@@@dom2@@checksum - String domsStatusString = WebUtils.required(request, "domsStatus"); + String statuses = WebUtils.required(request, "statuses"); String serverIP = WebUtils.optional(request, "clientIP", ""); if (!serverListManager.contains(serverIP)) { @@ -309,7 +309,7 @@ public class ServiceController { } try { - ServiceManager.ServiceChecksum checksums = JSON.parseObject(domsStatusString, ServiceManager.ServiceChecksum.class); + ServiceManager.ServiceChecksum checksums = JSON.parseObject(statuses, ServiceManager.ServiceChecksum.class); if (checksums == null) { Loggers.SRV_LOG.warn("[DOMAIN-STATUS] receive malformed data: null"); return "fail"; @@ -338,7 +338,7 @@ public class ServiceController { } } } catch (Exception e) { - Loggers.SRV_LOG.warn("[DOMAIN-STATUS] receive malformed data: " + domsStatusString, e); + Loggers.SRV_LOG.warn("[DOMAIN-STATUS] receive malformed data: " + statuses, e); } return "ok"; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java index a03680618..b39f731ad 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java @@ -59,7 +59,7 @@ public class ServiceManager implements DataListener { private LinkedBlockingDeque toBeUpdatedServicesQueue = new LinkedBlockingDeque<>(1024 * 1024); - private Synchronizer synchronizer = new DomainStatusSynchronizer(); + private Synchronizer synchronizer = new ServiceStatusSynchronizer(); private final Lock lock = new ReentrantLock(); diff --git a/naming/src/main/java/com/alibaba/nacos/naming/misc/DomainStatusSynchronizer.java b/naming/src/main/java/com/alibaba/nacos/naming/misc/ServiceStatusSynchronizer.java similarity index 96% rename from naming/src/main/java/com/alibaba/nacos/naming/misc/DomainStatusSynchronizer.java rename to naming/src/main/java/com/alibaba/nacos/naming/misc/ServiceStatusSynchronizer.java index a19bb9c0c..abce37b2a 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/misc/DomainStatusSynchronizer.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/misc/ServiceStatusSynchronizer.java @@ -27,7 +27,7 @@ import java.util.Map; /** * @author nacos */ -public class DomainStatusSynchronizer implements Synchronizer { +public class ServiceStatusSynchronizer implements Synchronizer { @Override public void send(final String serverIP, Message msg) { if(serverIP == null) { @@ -36,7 +36,7 @@ public class DomainStatusSynchronizer implements Synchronizer { Map params = new HashMap(10); - params.put("domsStatus", msg.getData()); + params.put("statuses", msg.getData()); params.put("clientIP", NetUtils.localServer());