check the required fields apollo when the Config mode starts (#1452)

pull/1454/head
学习笔记 10 months ago committed by GitHub
parent dd08019745
commit cf3c26c012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -86,4 +86,12 @@ public interface BootstrapPropertiesInterface {
default Map<String, String> getEtcd() {
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.");
}
}
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;
}
default:

Loading…
Cancel
Save