Commit fe1cadfc by Spencer Gibb

added logging to eureka client auto config;

fixed running.md typo; added comment to turbine eureka instance discovery
parent 5a2edc5a
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
## Sandbox Sample Backend ## Sandbox Sample Backend
`spring-platform-sandbox-sample-backend$ java -jar target/spring-platform-sandbox-sample-backend-1.0.0.BUILD-SNAPSHOT.jar`0 `spring-platform-sandbox-sample-backend$ java -jar target/spring-platform-sandbox-sample-backend-1.0.0.BUILD-SNAPSHOT.jar`
## Sandbox Sample Frontend ## Sandbox Sample Frontend
......
...@@ -18,6 +18,8 @@ package org.springframework.platform.netflix.eureka; ...@@ -18,6 +18,8 @@ package org.springframework.platform.netflix.eureka;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy; import javax.annotation.PreDestroy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
...@@ -43,6 +45,8 @@ import com.netflix.discovery.EurekaClientConfig; ...@@ -43,6 +45,8 @@ import com.netflix.discovery.EurekaClientConfig;
public class EurekaClientAutoConfiguration implements public class EurekaClientAutoConfiguration implements
ApplicationListener<ContextRefreshedEvent> { ApplicationListener<ContextRefreshedEvent> {
private static final Logger logger = LoggerFactory.getLogger(EurekaClientAutoConfiguration.class);
@Autowired @Autowired
private EurekaClientConfigBean clientConfig; private EurekaClientConfigBean clientConfig;
...@@ -51,6 +55,7 @@ public class EurekaClientAutoConfiguration implements ...@@ -51,6 +55,7 @@ public class EurekaClientAutoConfiguration implements
@Override @Override
public void onApplicationEvent(ContextRefreshedEvent event) { public void onApplicationEvent(ContextRefreshedEvent event) {
logger.info("Registering application {} with eureka with status UP", instanceConfig.getAppname());
ApplicationInfoManager.getInstance().setInstanceStatus(InstanceStatus.UP); ApplicationInfoManager.getInstance().setInstanceStatus(InstanceStatus.UP);
} }
...@@ -61,6 +66,7 @@ public class EurekaClientAutoConfiguration implements ...@@ -61,6 +66,7 @@ public class EurekaClientAutoConfiguration implements
@PreDestroy @PreDestroy
public void close() { public void close() {
logger.info("Removing application {} from eureka", instanceConfig.getAppname());
DiscoveryManager.getInstance().shutdownComponent(); DiscoveryManager.getInstance().shutdownComponent();
} }
......
...@@ -163,6 +163,7 @@ public class EurekaInstanceDiscovery implements InstanceDiscovery { ...@@ -163,6 +163,7 @@ public class EurekaInstanceDiscovery implements InstanceDiscovery {
*/ */
protected String getClusterName(InstanceInfo iInfo) { protected String getClusterName(InstanceInfo iInfo) {
return iInfo.getASGName(); return iInfo.getASGName();
//TODO: why did this break things? return iInfo.getAppGroupName();
} }
/** /**
......
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