Modify the format of polaris in BootstrapConfigProperties

pull/1470/head
MZR 2 years ago
parent ce69c6667a
commit fa04ebf9a5

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

@ -79,7 +79,7 @@ public class BootstrapConfigProperties implements BootstrapPropertiesInterface {
/**
* polaris config
*/
private Map<String, String> polaris;
private Map<String, Object> polaris;
/**
* Web config

@ -144,32 +144,39 @@ public class BeforeCheckConfiguration {
}
}
Map<String, String> polaris = properties.getPolaris();
Map<String, Object> polaris = properties.getPolaris();
if (MapUtil.isNotEmpty(polaris)) {
String namespace = polaris.get("namespace");
String namespace = polaris.get("namespace").toString();
if (StringUtil.isBlank(namespace)) {
throw new ConfigEmptyException(
"Web server failed to start. The dynamic thread pool polaris namespace is empty.",
"Web server maybe fail 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 (polaris.get("file") instanceof Map) {
Map<String, String> polarisFile = (Map<String, String>)polaris.get("file");
String fileGroup = polarisFile.get("group");
if (StringUtil.isBlank(fileGroup)) {
throw new ConfigEmptyException(
"Web server failed to start. The dynamic thread pool polaris file group is empty.",
"Web server maybe fail 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");
String fileName = polarisFile.get("name");
if (StringUtil.isBlank(fileName)) {
throw new ConfigEmptyException(
"Web server failed to start. The dynamic thread pool polaris file name is empty.",
"Web server maybe fail 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");
String fileType = polarisFile.get("type");
if (StringUtil.isBlank(fileType)) {
throw new ConfigEmptyException(
"Web server failed to start. The dynamic thread pool polaris file type is empty.",
"Web server maybe fail 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.");
}
} else {
throw new ConfigEmptyException(
"Web server maybe fail to start. Lack of the dynamic thread pool polaris file configuration.",
"Please check whether the [spring.dynamic.thread-pool.polaris.file.*] configuration is complete.");
}
}
break;
}

Loading…
Cancel
Save