check the required fields of polaris when the config mode starts

pull/1470/head
MZR 2 years ago
parent e98b106cb1
commit f329fd8e44

@ -101,4 +101,11 @@ public interface BootstrapPropertiesInterface {
return null; return null;
} }
/**
* Get Polaris.
*/
default Map<String, String> getPolaris() {
return null;
}
} }

@ -76,6 +76,11 @@ public class BootstrapConfigProperties implements BootstrapPropertiesInterface {
*/ */
private Map<String, String> etcd; private Map<String, String> etcd;
/**
* polaris config
*/
private Map<String, String> polaris;
/** /**
* Web config * Web config
* *

@ -144,6 +144,33 @@ public class BeforeCheckConfiguration {
} }
} }
Map<String, String> polaris = properties.getPolaris();
if (MapUtil.isNotEmpty(polaris)) {
String namespace = polaris.get("namespace");
if (StringUtil.isBlank(namespace)) {
throw new ConfigEmptyException(
"Web server failed to start. The dynamic thread pool polaris namespace is empty.",
"Please check whether the [spring.dynamic.thread-pool.polaris.namespace] configuration is empty or an empty string.");
}
String fileGroup = polaris.get("file.group");
if (StringUtil.isBlank(fileGroup)) {
throw new ConfigEmptyException(
"Web server failed to start. The dynamic thread pool polaris file group is empty.",
"Please check whether the [spring.dynamic.thread-pool.polaris.file.group] configuration is empty or an empty string.");
}
String fileName = polaris.get("file.name");
if (StringUtil.isBlank(fileName)) {
throw new ConfigEmptyException(
"Web server failed to start. The dynamic thread pool polaris file name is empty.",
"Please check whether the [spring.dynamic.thread-pool.polaris.file.name] configuration is empty or an empty string.");
}
String fileType = polaris.get("file.type");
if (StringUtil.isBlank(fileType)) {
throw new ConfigEmptyException(
"Web server failed to start. The dynamic thread pool polaris file type is empty.",
"Please check whether the [spring.dynamic.thread-pool.polaris.file.type] configuration is empty or an empty string.");
}
}
break; break;
} }
default: default:

Loading…
Cancel
Save