added ipAddress to ServiceInstance
This commit is contained in:
@@ -8,5 +8,6 @@ package org.springframework.cloud.client;
|
||||
public interface ServiceInstance {
|
||||
public String getServiceId();
|
||||
public String getHost();
|
||||
public String getIpAddress();
|
||||
public int getPort();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,11 @@ public class EurekaDiscoverClient implements DiscoveryClient {
|
||||
return config.getHostname();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIpAddress() {
|
||||
return config.getIpAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPort() {
|
||||
return config.getNonSecurePort();
|
||||
|
||||
@@ -44,6 +44,11 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
|
||||
return server.getHost();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIpAddress() {
|
||||
return null; //TODO: ribbon doesn't supply ip
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPort() {
|
||||
return server.getPort();
|
||||
|
||||
Reference in New Issue
Block a user