Skip to content
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

feature:check the required fields etcd when the Config mode starts(#1… #1440

Merged
merged 1 commit into from
Sep 2, 2023
Merged
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 @@ -79,4 +79,11 @@ default Boolean getBanner() {
default Map<String, String> getNacos() {
return null;
}

/**
* Get etcd.
*/
default Map<String, String> getEtcd() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ public BeforeCheckConfiguration.BeforeCheck dynamicThreadPoolBeforeCheckBean(@Au
"Please check whether the [spring.dynamic.thread-pool.nacos.data-id] configuration is empty or an empty string.");
}
}
Map<String, String> etcd = properties.getEtcd();
if (MapUtil.isNotEmpty(etcd)){
String endpoints = etcd.get("endpoints");
if ((StringUtil.isBlank(endpoints))){
throw new ConfigEmptyException(
"Web server failed to start. The dynamic thread pool etcd endpoints is empty.",
"Please check whether the [spring.dynamic.thread-pool.etcd.endpoints] configuration is empty or an empty string.");
}
String key = etcd.get("key");
if ((StringUtil.isBlank(key))){
throw new ConfigEmptyException(
"Web server failed to start. The dynamic thread pool etcd key is empty.",
"Please check whether the [spring.dynamic.thread-pool.etcd.key] configuration is empty or an empty string.");
}
}
break;
}
default:
Expand Down