import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.Liveness;
import javax.enterprise.context.ApplicationScoped;
@Liveness
@ApplicationScoped
public class HealthTest implements HealthCheck {
@Override
public HealthCheckResponse call() {
return HealthCheckResponse.named("health-test").up().build();
}
}
import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.Liveness;
import javax.enterprise.context.ApplicationScoped;
@Liveness
@ApplicationScoped
public class HealthTest implements HealthCheck {
@Override
public HealthCheckResponse call() {
return HealthCheckResponse.named("health-test").up().build();
}
}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
[standalone@localhost:9990 /] /subsystem=microprofile-health-smallrye:check
{
"outcome" => "success",
"result" => {
"status" => "UP",
"checks" => [
{
"name" => "deployments-status",
"status" => "UP",
"data" => {"<deployment_name>.war" => "OK"}
},
{
"name" => "server-state",
"status" => "UP",
"data" => {"value" => "running"}
},
{
"name" => "boot-errors",
"status" => "UP"
},
{
"name" => "health-test",
"status" => "UP"
},
{
"name" => "ready-deployment.<deployment_name>.war,
"status" => "UP"
},
{
"name" => "started-deployment.<deployment_name>.war",
"status" => "UP"
}
]
}
}
[standalone@localhost:9990 /] /subsystem=microprofile-health-smallrye:check
{
"outcome" => "success",
"result" => {
"status" => "UP",
"checks" => [
{
"name" => "deployments-status",
"status" => "UP",
"data" => {"<deployment_name>.war" => "OK"}
},
{
"name" => "server-state",
"status" => "UP",
"data" => {"value" => "running"}
},
{
"name" => "boot-errors",
"status" => "UP"
},
{
"name" => "health-test",
"status" => "UP"
},
{
"name" => "ready-deployment.<deployment_name>.war,
"status" => "UP"
},
{
"name" => "started-deployment.<deployment_name>.war",
"status" => "UP"
}
]
}
}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow