Skip to content

Commit

Permalink
check the required fields apollo when the Config mode starts (opengoo…
Browse files Browse the repository at this point in the history
  • Loading branch information
Myboolean authored Sep 7, 2023
1 parent dd08019 commit cf3c26c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,12 @@ default Map<String, String> getNacos() {
default Map<String, String> getEtcd() {
return null;
}

/**
* Get apollo.
*/
default Map<String, String> getApollo(){
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ public BeforeCheckConfiguration.BeforeCheck dynamicThreadPoolBeforeCheckBean(@Au
"Please check whether the [spring.dynamic.thread-pool.etcd.key] configuration is empty or an empty string.");
}
}

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

0 comments on commit cf3c26c

Please sign in to comment.