Commit 3e0e4761 by Spencer Gibb

Do not require eurekaConfig.

Helps when eureka is on the classpath, but is explicitly disabled. fixes gh-521
parent a96666b9
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment