O'Reilly logo

Hands-On Enterprise Java Microservices with Eclipse MicroProfile by Scott Stark, Antoine Sabot-Durand, Pavol Loffay, Jeff Mesnil, Heiko W. Rupp, Cesar Saavedra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Health Check Java API

Most of the plumbing is performed by the application framework that implements the MP-HC specification. Your part is to decide how liveness or readiness are determined through the health check procedures that your microservice defines using the MP-HC API.

To do this, you need to implement a health check procedure by implementing one or more instances of the HealthCheck interface using beans that are marked with a Health annotation.

The HealthCheck interface is provided in the following code block:

package org.eclipse.microprofile.health;@FunctionalInterfacepublic interface HealthCheck {  HealthCheckResponse call();}

The code for the Health annotation is provided in the following code block:

package org.eclipse.microprofile.health; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required