Skip to content

feature:check the required fields consul when the Config mode starts #1532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,10 @@ default Map<String, Object> getPolaris() {
return null;
}

/**
* Get consul.
*/
default Map<String, String> getConsul() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ public class BootstrapConfigProperties implements BootstrapPropertiesInterface {
*/
private Map<String, Object> polaris;

/**
* Consul config
*/
private Map<String, String> consul;

/**
* Web config
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ public BeforeCheckConfiguration.BeforeCheck dynamicThreadPoolBeforeCheckBean(@Au
"Please check whether the [spring.dynamic.thread-pool.polaris.file.type] configuration is empty or an empty string.");
}
}

Map<String, String> consul = properties.getConsul();
if (MapUtil.isNotEmpty(consul)) {
String dataKey = consul.get("data-key");
if (StringUtil.isBlank(dataKey)) {
throw new ConfigEmptyException(
"Web server maybe fail to start. The dynamic thread pool consul data-key is empty.",
"Please check whether the [spring.dynamic.thread-pool.consul.data-key] configuration is empty or an empty string.");
}
}
break;
}
default:
Expand Down