Enable eureka.client.healthcheck

16,436

Solution 1

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.

Solution 2

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.

Share:
16,436
Oleksandr
Author by

Oleksandr

Updated on June 04, 2022

Comments

  • Oleksandr
    Oleksandr almost 2 years

    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