diff --git a/console/src/main/resources/application.properties b/console/src/main/resources/application.properties index 64c42676e..7e6495697 100644 --- a/console/src/main/resources/application.properties +++ b/console/src/main/resources/application.properties @@ -1,6 +1,5 @@ # spring -server.contextPath=/nacos server.servlet.contextPath=/nacos server.port=8848 diff --git a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/HealthCheckProcessorDelegate.java b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/HealthCheckProcessorDelegate.java index 1de6acb09..e85af4a69 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/HealthCheckProcessorDelegate.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/HealthCheckProcessorDelegate.java @@ -50,7 +50,7 @@ public class HealthCheckProcessorDelegate implements HealthCheckProcessor { String type = task.getCluster().getHealthChecker().getType(); HealthCheckProcessor processor = healthCheckProcessorMap.get(type); if(processor == null){ - processor = healthCheckProcessorMap.get("none"); + processor = healthCheckProcessorMap.get(NoneHealthCheckProcessor.TYPE); } processor.process(task); diff --git a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/HttpHealthCheckProcessor.java b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/HttpHealthCheckProcessor.java index 064de1e12..b03f7e359 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/HttpHealthCheckProcessor.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/HttpHealthCheckProcessor.java @@ -47,6 +47,8 @@ import static com.alibaba.nacos.naming.misc.Loggers.SRV_LOG; @Component public class HttpHealthCheckProcessor implements HealthCheckProcessor { + public static final String TYPE = "HTTP"; + @Autowired private SwitchDomain switchDomain; @@ -79,7 +81,7 @@ public class HttpHealthCheckProcessor implements HealthCheckProcessor { @Override public String getType() { - return "HTTP"; + return TYPE; } @Override diff --git a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/MysqlHealthCheckProcessor.java b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/MysqlHealthCheckProcessor.java index 756d7fcba..1ce59f46c 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/MysqlHealthCheckProcessor.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/MysqlHealthCheckProcessor.java @@ -45,6 +45,8 @@ import static com.alibaba.nacos.naming.misc.Loggers.SRV_LOG; @Component public class MysqlHealthCheckProcessor implements HealthCheckProcessor { + public static final String TYPE = "MYSQL"; + @Autowired private HealthCheckCommon healthCheckCommon; @@ -83,7 +85,7 @@ public class MysqlHealthCheckProcessor implements HealthCheckProcessor { @Override public String getType() { - return "MYSQL"; + return TYPE; } @Override diff --git a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/NoneHealthCheckProcessor.java b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/NoneHealthCheckProcessor.java index c7bf4a84d..221e6770d 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/NoneHealthCheckProcessor.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/NoneHealthCheckProcessor.java @@ -26,12 +26,14 @@ import org.springframework.stereotype.Component; @Component public class NoneHealthCheckProcessor implements HealthCheckProcessor { + public static final String TYPE = "NONE"; + @Override public void process(HealthCheckTask task) { } @Override public String getType() { - return "NONE"; + return TYPE; } } diff --git a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/TcpSuperSenseProcessor.java b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/TcpSuperSenseProcessor.java index 4d6cb676c..117a231e2 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/TcpSuperSenseProcessor.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/TcpSuperSenseProcessor.java @@ -43,6 +43,8 @@ import static com.alibaba.nacos.naming.misc.Loggers.SRV_LOG; @Component public class TcpSuperSenseProcessor implements HealthCheckProcessor, Runnable { + public static final String TYPE = "TCP"; + @Autowired private HealthCheckCommon healthCheckCommon; @@ -420,6 +422,6 @@ public class TcpSuperSenseProcessor implements HealthCheckProcessor, Runnable { @Override public String getType() { - return "TCP"; + return TYPE; } }