check the required fields apollo when the Config mode starts

pull/1452/head
MyBoolean 2 years ago
parent dd08019745
commit d6758b241e

@ -86,4 +86,12 @@ public interface BootstrapPropertiesInterface {
default Map<String, String> getEtcd() { default Map<String, String> getEtcd() {
return null; return null;
} }
/**
* Get apollo.
*/
default Map<String, String> getApollo(){
return null;
}
} }

@ -105,6 +105,16 @@ public class BeforeCheckConfiguration {
"Please check whether the [spring.dynamic.thread-pool.etcd.key] configuration is empty or an empty string."); "Please check whether the [spring.dynamic.thread-pool.etcd.key] configuration is empty or an empty string.");
} }
} }
Map<String, String> 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; break;
} }
default: default:

Loading…
Cancel
Save