|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
package cn.hippo4j.starter.enable;
|
|
|
|
|
|
|
|
|
|
import cn.hippo4j.common.toolkit.StringUtil;
|
|
|
|
|
import cn.hippo4j.starter.config.BootstrapProperties;
|
|
|
|
|
import cn.hippo4j.starter.core.ConfigEmptyException;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
@ -24,7 +24,7 @@ public class BeforeCheckConfiguration {
|
|
|
|
|
ConfigurableEnvironment environment) {
|
|
|
|
|
if (properties != null) {
|
|
|
|
|
String username = properties.getUsername();
|
|
|
|
|
if (StrUtil.isBlank(username)) {
|
|
|
|
|
if (StringUtil.isBlank(username)) {
|
|
|
|
|
throw new ConfigEmptyException(
|
|
|
|
|
"Web server failed to start. The dynamic thread pool username is empty.",
|
|
|
|
|
"Please check whether the [spring.dynamic.thread-pool.username] configuration is empty or an empty string."
|
|
|
|
@ -32,7 +32,7 @@ public class BeforeCheckConfiguration {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String password = properties.getPassword();
|
|
|
|
|
if (StrUtil.isBlank(password)) {
|
|
|
|
|
if (StringUtil.isBlank(password)) {
|
|
|
|
|
throw new ConfigEmptyException(
|
|
|
|
|
"Web server failed to start. The dynamic thread pool password is empty.",
|
|
|
|
|
"Please check whether the [spring.dynamic.thread-pool.password] configuration is empty or an empty string."
|
|
|
|
@ -40,7 +40,7 @@ public class BeforeCheckConfiguration {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String namespace = properties.getNamespace();
|
|
|
|
|
if (StrUtil.isBlank(namespace)) {
|
|
|
|
|
if (StringUtil.isBlank(namespace)) {
|
|
|
|
|
throw new ConfigEmptyException(
|
|
|
|
|
"Web server failed to start. The dynamic thread pool namespace is empty.",
|
|
|
|
|
"Please check whether the [spring.dynamic.thread-pool.namespace] configuration is empty or an empty string."
|
|
|
|
@ -48,7 +48,7 @@ public class BeforeCheckConfiguration {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String itemId = properties.getItemId();
|
|
|
|
|
if (StrUtil.isBlank(itemId)) {
|
|
|
|
|
if (StringUtil.isBlank(itemId)) {
|
|
|
|
|
throw new ConfigEmptyException(
|
|
|
|
|
"Web server failed to start. The dynamic thread pool item id is empty.",
|
|
|
|
|
"Please check whether the [spring.dynamic.thread-pool.item-id] configuration is empty or an empty string."
|
|
|
|
@ -56,7 +56,7 @@ public class BeforeCheckConfiguration {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String serverAddr = properties.getServerAddr();
|
|
|
|
|
if (StrUtil.isBlank(serverAddr)) {
|
|
|
|
|
if (StringUtil.isBlank(serverAddr)) {
|
|
|
|
|
throw new ConfigEmptyException(
|
|
|
|
|
"Web server failed to start. The dynamic thread pool server addr is empty.",
|
|
|
|
|
"Please check whether the [spring.dynamic.thread-pool.server-addr] configuration is empty or an empty string."
|
|
|
|
@ -64,7 +64,7 @@ public class BeforeCheckConfiguration {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String applicationName = environment.getProperty("spring.application.name");
|
|
|
|
|
if (StrUtil.isBlank(applicationName)) {
|
|
|
|
|
if (StringUtil.isBlank(applicationName)) {
|
|
|
|
|
throw new ConfigEmptyException(
|
|
|
|
|
"Web server failed to start. The dynamic thread pool application name is empty.",
|
|
|
|
|
"Please check whether the [spring.application.name] configuration is empty or an empty string."
|
|
|
|
|