diff --git a/kernel/dynamic/api/src/main/java/cn/hippo4j/threadpool/dynamic/api/BootstrapPropertiesInterface.java b/kernel/dynamic/api/src/main/java/cn/hippo4j/threadpool/dynamic/api/BootstrapPropertiesInterface.java index fe514c83..2f47e414 100644 --- a/kernel/dynamic/api/src/main/java/cn/hippo4j/threadpool/dynamic/api/BootstrapPropertiesInterface.java +++ b/kernel/dynamic/api/src/main/java/cn/hippo4j/threadpool/dynamic/api/BootstrapPropertiesInterface.java @@ -86,4 +86,12 @@ public interface BootstrapPropertiesInterface { default Map getEtcd() { return null; } + + /** + * Get apollo. + */ + default Map getApollo(){ + return null; + } + } diff --git a/threadpool/core/src/main/java/cn/hippo4j/core/enable/BeforeCheckConfiguration.java b/threadpool/core/src/main/java/cn/hippo4j/core/enable/BeforeCheckConfiguration.java index cf56f4ae..e1f6fed1 100644 --- a/threadpool/core/src/main/java/cn/hippo4j/core/enable/BeforeCheckConfiguration.java +++ b/threadpool/core/src/main/java/cn/hippo4j/core/enable/BeforeCheckConfiguration.java @@ -105,6 +105,16 @@ public class BeforeCheckConfiguration { "Please check whether the [spring.dynamic.thread-pool.etcd.key] configuration is empty or an empty string."); } } + + Map apollo = properties.getApollo(); + if (MapUtil.isNotEmpty(apollo)) { + String namespace = apollo.get("namespace"); + if (StringUtil.isBlank(namespace)) { + throw new ConfigEmptyException( + "Web server failed to start. The dynamic thread pool apollo namespace is empty.", + "Please check whether the [spring.dynamic.thread-pool.apollo.namespace] configuration is empty or an empty string."); + } + } break; } default: