Merge pull request #575 from alexVengrovsk/master
* pull575: Use "<>" and use isInfoEnabled
This commit is contained in:
@@ -110,7 +110,7 @@ public class EurekaClientConfigBean implements EurekaClientConfig {
|
||||
|
||||
private String fetchRemoteRegionsRegistry;
|
||||
|
||||
private Map<String, String> availabilityZones = new HashMap<String, String>();
|
||||
private Map<String, String> availabilityZones = new HashMap<>();
|
||||
|
||||
private boolean filterOnlyUpInstances = true;
|
||||
|
||||
|
||||
@@ -95,9 +95,12 @@ public class EurekaDiscoveryClientConfiguration implements SmartLifecycle, Order
|
||||
if (!this.running.get() && this.instanceConfig.getNonSecurePort() > 0) {
|
||||
|
||||
this.eurekaClient.getApplications(); // force initialization
|
||||
log.info("Registering application " + this.instanceConfig.getAppname()
|
||||
+ " with eureka with status "
|
||||
+ this.instanceConfig.getInitialStatus());
|
||||
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Registering application " + this.instanceConfig.getAppname()
|
||||
+ " with eureka with status "
|
||||
+ this.instanceConfig.getInitialStatus());
|
||||
}
|
||||
|
||||
this.applicationInfoManager
|
||||
.setInstanceStatus(this.instanceConfig.getInitialStatus());
|
||||
@@ -114,8 +117,12 @@ public class EurekaDiscoveryClientConfiguration implements SmartLifecycle, Order
|
||||
@Override
|
||||
public void stop() {
|
||||
if (this.applicationInfoManager.getInfo() != null) {
|
||||
log.info("Unregistering application " + this.instanceConfig.getAppname()
|
||||
+ " with eureka with status DOWN");
|
||||
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Unregistering application " + this.instanceConfig.getAppname()
|
||||
+ " with eureka with status DOWN");
|
||||
}
|
||||
|
||||
this.applicationInfoManager.setInstanceStatus(InstanceStatus.DOWN);
|
||||
}
|
||||
this.running.set(false);
|
||||
|
||||
@@ -64,14 +64,18 @@ public class InstanceInfoFactory {
|
||||
// Start off with the STARTING state to avoid traffic
|
||||
if (!config.isInstanceEnabledOnit()) {
|
||||
InstanceInfo.InstanceStatus initialStatus = InstanceInfo.InstanceStatus.STARTING;
|
||||
log.info("Setting initial instance status as: " + initialStatus);
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Setting initial instance status as: " + initialStatus);
|
||||
}
|
||||
builder.setStatus(initialStatus);
|
||||
}
|
||||
else {
|
||||
log.info("Setting initial instance status as: "
|
||||
+ InstanceInfo.InstanceStatus.UP
|
||||
+ ". This may be too early for the instance to advertise itself as available. "
|
||||
+ "You would instead want to control this via a healthcheck handler.");
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Setting initial instance status as: "
|
||||
+ InstanceInfo.InstanceStatus.UP
|
||||
+ ". This may be too early for the instance to advertise itself as available. "
|
||||
+ "You would instead want to control this via a healthcheck handler.");
|
||||
}
|
||||
}
|
||||
|
||||
// Add any user-specific metadata information
|
||||
|
||||
Reference in New Issue
Block a user