Do not require eurekaConfig.
Helps when eureka is on the classpath, but is explicitly disabled. fixes gh-521
This commit is contained in:
@@ -69,7 +69,7 @@ public class EurekaRibbonClientConfiguration {
|
||||
@Autowired(required = false)
|
||||
private EurekaClientConfig clientConfig;
|
||||
|
||||
@Autowired
|
||||
@Autowired(required = false)
|
||||
private EurekaInstanceConfig eurekaConfig;
|
||||
|
||||
public EurekaRibbonClientConfiguration() {
|
||||
@@ -112,7 +112,7 @@ public class EurekaRibbonClientConfiguration {
|
||||
String zone = ConfigurationManager.getDeploymentContext().getValue(
|
||||
ContextKey.zone);
|
||||
if (this.clientConfig != null && StringUtils.isEmpty(zone)) {
|
||||
if (approximateZoneFromHostname) {
|
||||
if (approximateZoneFromHostname && eurekaConfig != null) {
|
||||
String approxZone = ZoneUtils.extractApproximateZone(eurekaConfig
|
||||
.getHostName(false));
|
||||
log.debug("Setting Zone To " + approxZone);
|
||||
|
||||
Reference in New Issue
Block a user