Implements getServiceId
This commit is contained in:
@@ -102,6 +102,11 @@ public class ZookeeperServiceDiscovery implements ZookeeperRegistration, Applica
|
||||
this.appName = resolver.getProperty("spring.application.name", "application");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getServiceId() {
|
||||
return this.appName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds Service Instance - needs to be used when you want to register your application
|
||||
* in Zookeeper
|
||||
|
||||
@@ -130,6 +130,14 @@ public class ServiceInstanceRegistration implements ZookeeperRegistration {
|
||||
this.serviceInstance = this.builder.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getServiceId() {
|
||||
if (this.serviceInstance == null) {
|
||||
return null;
|
||||
}
|
||||
return this.serviceInstance.getName();
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
if (this.serviceInstance == null) {
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user