liveBook · Manning

Readiness check

As explained in Quarkus in Action

A readiness probe is a Kubernetes health check that determines whether a container is ready to receive traffic.

A readiness check reports whether an application can receive traffic now. Kubernetes uses the result through a readiness probe: when the check fails, Kubernetes stops sending traffic to the pod until the condition is resolved. This differs from a liveness check, which signals an unrecoverable problem and can trigger a restart. section 10.2

MicroProfile Health exposes health information through HTTP endpoints. In Quarkus, SmallRye Health implements the feature, and the readiness results are available at the health endpoints, including `/q/health/ready`; `/q/health` returns all health checks grouped by type. section 10.2 section 10.2.1

A readiness check is useful when a service should remain running but temporarily stop receiving requests:

  • Quarkus automatically adds a readiness check for each JDBC data source and verifies that the database connection works. section 10.2.1
  • A failed database check reports that the application cannot process requests, allowing traffic to be withheld without treating the condition as a restart-worthy failure. section 10.2 section 10.2.1
  • Readiness is evaluated periodically by monitoring tools or Kubernetes at configured probe intervals. section 10.2

Checking the Inventory service

Add the SmallRye Health extension with `quarkus extension add smallrye-health`, then run the Inventory service in Dev mode. Quarkus starts the MySQL instance through Dev Services and exposes a database readiness check. The Dev UI can show its status, while `http://localhost:8083/q/health` returns JSON. With the database available, the check is `UP`; after stopping the MySQL container, the overall status and database check become `DOWN`, including the connection error. section 10.2.1

How Quarkus in Action covers it

How deep it goes
Explains failure semantics, HTTP endpoints, automatic JDBC checks, Dev UI inspection, and a database outage demonstration.
Examples
Demonstrates an Inventory service, MySQL through Dev Services, the Quarkus Dev UI, health JSON, and a stopped database container.
What it assumes
Builds from basic Kubernetes probe roles, HTTP health endpoints, Quarkus extensions, and JDBC database connectivity.
What you can do after
Operate/configure Quarkus health monitoring and diagnose readiness failures through endpoints, Dev UI, and database status.
How it connects
Connects Kubernetes, MicroProfile Health, SmallRye Health, liveness probes, startup probes, HTTP endpoints, and JDBC data sources.

Also explained in

Compare how 7 books explain readiness check →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.