Browse Source

added logging to eureka client auto config;

fixed running.md typo;
added comment to turbine eureka instance discovery
pull/6/head
Spencer Gibb 10 years ago
parent
commit
fe1cadfc52
  1. 2
      RUNNING.md
  2. 6
      spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/eureka/EurekaClientAutoConfiguration.java
  3. 1
      spring-platform-netflix-turbine/src/main/java/io/spring/platform/netflix/turbine/EurekaInstanceDiscovery.java

2
RUNNING.md

@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
## 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

6
spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/eureka/EurekaClientAutoConfiguration.java

@ -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.PreDestroy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
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
ApplicationListener<ContextRefreshedEvent> {
private static final Logger logger = LoggerFactory.getLogger(EurekaClientAutoConfiguration.class);
@Autowired
private EurekaClientConfigBean clientConfig;
@ -51,6 +55,7 @@ public class EurekaClientAutoConfiguration implements @@ -51,6 +55,7 @@ public class EurekaClientAutoConfiguration implements
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
logger.info("Registering application {} with eureka with status UP", instanceConfig.getAppname());
ApplicationInfoManager.getInstance().setInstanceStatus(InstanceStatus.UP);
}
@ -61,6 +66,7 @@ public class EurekaClientAutoConfiguration implements @@ -61,6 +66,7 @@ public class EurekaClientAutoConfiguration implements
@PreDestroy
public void close() {
logger.info("Removing application {} from eureka", instanceConfig.getAppname());
DiscoveryManager.getInstance().shutdownComponent();
}

1
spring-platform-netflix-turbine/src/main/java/io/spring/platform/netflix/turbine/EurekaInstanceDiscovery.java

@ -163,6 +163,7 @@ public class EurekaInstanceDiscovery implements InstanceDiscovery { @@ -163,6 +163,7 @@ public class EurekaInstanceDiscovery implements InstanceDiscovery {
*/
protected String getClusterName(InstanceInfo iInfo) {
return iInfo.getASGName();
//TODO: why did this break things? return iInfo.getAppGroupName();
}
/**

Loading…
Cancel
Save