Skip to content
Ameen Abozaid
Planned lessonJNR-052-L04

Health checks: liveness vs readiness

  • Lesson 4 of 7
  • Junior
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

expose and use the two health signals.

Planned topics

  • Liveness asks: "is the process stuck and in need of a restart?"
  • Readiness asks: "can the app take traffic now?" (for example, the database is reachable).
  • Spring Boot Actuator exposes /actuator/health/liveness and /actuator/health/readiness (enable the probes; verify properties for your version).
  • Do not check the database in liveness: a database outage would restart healthy apps and make things worse.
  • Expose only the health endpoint publicly; keep other actuator endpoints private.
Draft outline details

Demonstration

yaml
management:
  endpoint.health.probes.enabled: true
  endpoints.web.exposure.include: health

Check your understanding

Which probe should fail when the database is down?

Show answer

Readiness.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.