Class HealthResource
- All Implemented Interfaces:
BasicUniversalConfig,DefaultConfig,DefaultHtmlConfig
Mounts as a routed child via @Rest(children=HealthResource.class)
under a parent at the subtree /health and serves the /healthz, /readyz, and
/livez probe endpoints by delegating to a shared HealthAggregator worker bean —
the same logic the servlet and mixin flavors use, so the
three forms cannot drift.
Indicators are resolved from the host's bean store, so a host registers its own
HealthIndicator beans (e.g. via Spring @Bean or a Juneau BeanStore).
Extends BasicRestResource — the child-flavor mirror of BasicRestServlet that the
HealthServlet servlet flavor extends — so the HealthAggregator.HealthResponse
bean returned by the probe ops is serialized out of the box via the BasicUniversalConfig
serializer set (JSON/XML/HTML/…). A bare RestResource child would carry no serializers
and force every consumer to re-declare one; deriving from BasicRestResource keeps the child
flavor at parity with its servlet twin.
See Also:
- Since:
- 10.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.rest.server.servlet.RestResource
RestResource.Builder<R extends RestResource,SELF extends RestResource.Builder<R, SELF>>, RestResource.DefaultBuilder<R extends RestResource> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhealthz(RestRequest req, RestResponse res) Health probe endpoint.livez(RestRequest req, RestResponse res) Liveness probe endpoint.readyz(RestRequest req, RestResponse res) Readiness probe endpoint.Methods inherited from class org.apache.juneau.rest.server.servlet.RestResource
builder, doLog, getContext, getPaths, getRequest, getResponse, getRestBuilder, log, log, setContext
-
Constructor Details
-
HealthResource
public HealthResource()
-
-
Method Details
-
healthz
Health probe endpoint.- Parameters:
req- The request.res- The response.- Returns:
- Aggregated health payload.
-
readyz
Readiness probe endpoint.- Parameters:
req- The request.res- The response.- Returns:
- Aggregated health payload.
-
livez
Liveness probe endpoint.- Parameters:
req- The request.res- The response.- Returns:
- Aggregated health payload.
-