4
votes

I'm following http://cloud.spring.io/spring-cloud-netflix/spring-cloud-netflix.html to build distributed system with Spring Cloud.

All works as expected apart from Eureka Client Healthcheck.

I have

eureka: client: healthcheck: enabled: true

And pointing my service to nonexisten config_server, this results in

http://myservice:8080/health { status: "DOWN" }

But Eureka server still showing this instance as UP and keep sending traffic to it.

What am I missing?

spring-boot: 1.2.8.RELEASE

spring-cloud-netflix : 1.0.4.RELEASE

2
Please, attach the used Spring cloud version too. BTW, eureka sometimes takes a time to notice a service is down (that depends on how your services send heartbeats to it). Have you tried waiting for a while?Xtreme Biker

2 Answers

3
votes

You have to explicitly set eureka.client.healthcheck.enabled=true to link the Spring Boot health indicator to the Eureka registration. Source code reference: here.

2
votes

Ok, I think I found it.

According to https://jmnarloch.wordpress.com/2015/09/02/spring-cloud-fixing-eureka-application-status/ this feature will only be available on Spring Cloud 1.1.

To make it work with 1.0.4 I need to implement my own HealthCheckHandler.

Thanks @xtreme-biker for bringing up Spring Cloud version issue.