The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Andries Mortier (4) [Avatar] Offline

On chapter 6 about Zuul and Eureka, i'm "playing" a little bit to see how it reacts on certain cases.
So basically i've setup a Spring Sidecar on a cassandra cluster. So far so good smilie

Then i wanted to implement a health check to set it to status "DOWN", however Eureka shows it as status "UP"
Apparently Eureka doesn't take into count default the "DOWN" status. (refr. documentation below)

So my question is, what is the best practice?
Alter the health checks?

- if no, how can i be notified it's actually "DOWN"?

- if yes, what are the consequences and if i may ask, would you have a working example,
cause for some reason my Intellij can't recognize the "eureka.client.healthcheck.enabled": "true" property
it is a little bit related to this post i've found
however i'm lost about the "discovery to bootstrap configuration" reply...

Thank you in advance !


Referring to the documentation

Eureka’s Health Checks

By default, Eureka uses the client heartbeat to determine if a client is up. Unless specified otherwise the Discovery Client will not propagate the current health check status of the application per the Spring Boot Actuator. Which means that after successful registration Eureka will always announce that the application is in 'UP' state. This behaviour can be altered by enabling Eureka health checks, which results in propagating application status to Eureka. As a consequence every other application won’t be sending traffic to application in state other then 'UP'.

enabled: true

eureka.client.healthcheck.enabled=true should only be set in application.yml. Setting the value in bootstrap.yml will cause undesirable side effects like registering in eureka with an UNKNOWN status.

Andries Mortier (4) [Avatar] Offline
fixed it myself not using that property
if you ever wonder how,
       final DiscoveryClient discoveryClient = context.getBean(DiscoveryClient.class);
        discoveryClient.registerHealthCheck(new CassandraHealth());