Skip to content

Commit

Permalink
[SCB-2056]print a verbose log when no registration is configured
Browse files Browse the repository at this point in the history
  • Loading branch information
liubao68 committed Jul 31, 2020
1 parent 823ad39 commit 8e721bd
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -85,10 +85,19 @@ public MicroserviceInstance getMicroserviceInstance() {
}

public Microservice getMicroservice() {
assertPrimaryNotNull();
return primary.getMicroservice();
}

private void assertPrimaryNotNull() {
if (primary == null) {
throw new NullPointerException("At least one Registration implementation configured. Missed"
+ " to include dependency ? e.g. <artifactId>registry-service-center</artifactId>");
}
}

public String getAppId() {
assertPrimaryNotNull();
return primary.getAppId();
}

Expand Down

0 comments on commit 8e721bd

Please sign in to comment.