Simplest Possible Microprofile Liveness Check

A health check can be exposed using the qualifier exposing a HealthCheckResponse:

import javax.enterprise.context.ApplicationScoped;
public class LivenessCheck implements HealthCheck {

    public HealthCheckResponse call() {
        return HealthCheckResponse.
                withData("duke", "lives").


The health check is available from the "root" URL (not the WAR URI):

curl http://localhost:8080/health outputs:


The API is included in the microprofile BOM:


The above example comes with 4.2 kB WAR and runs on stock Payara Server 5. Payara 5 comes with Java EE 8 and microprofile 1.2 support.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home:


Unfortunately there are some bugs in the Payara Healthcheck.

Posted by Bastian on April 17, 2018 at 03:42 PM CEST #

Hi Bastian, the issues you linked are not bugs but points not yet covered by the MicroProfile Health specification. What those issues report is a missing "readiness" check to report when applications are ready to respond or failed deployment. This should be addressed in the future but it's a problem in any MicroProfile Health implementation, not only in Payara

Posted by Ondro on July 23, 2018 at 11:37 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
...the last 150 posts
...the last 10 comments