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

fix judgment for registry configed in DefaultApplicationDeployer #14874

Open
wants to merge 2 commits into
base: 3.3
Choose a base branch
from
Open
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 @@ -782,14 +782,17 @@ public void prepareApplicationInstance(ModuleModel moduleModel) {
// export MetricsService
exportMetricsService();

if (moduleModel.getDeployer().hasRegistryInteraction()) {
boolean registryConfiged = CollectionUtils.isNotEmpty(
moduleModel.getApplicationModel().getApplicationConfigManager().getRegistries());

if (registryConfiged) {
ApplicationConfig applicationConfig = configManager.getApplicationOrElseThrow();
if (DEFAULT_APP_NAME.equals(applicationConfig.getName())) {
throw new IllegalStateException("Application name must be set when registry is enabled.");
}
}

if (isRegisterConsumerInstance() || moduleModel.getDeployer().hasRegistryInteraction()) {
if (isRegisterConsumerInstance() || registryConfiged) {
if (hasPreparedApplicationInstance.compareAndSet(false, true)) {
// register the local ServiceInstance if required
registerServiceInstance();
Expand Down
Loading