quarkushealth-monitoringhealth-checkmicroprofile

Optional aka informative health checks in MicroProfile Health


From what I understand the MicroProfile Health specification does not support "optional" or "informative" health checks, correct?

Use case

Application subscribes to Kafka topics and provides services beyond that. It is perfectly fine from the application consumer's point of view if it occasionally looses connection to Kafka i.e. that connection is non-essential.

Still, I'd like the health overview to report on each topic the application subscribed to and how many consumers it has running for each.

Problem

I feel that none of the @Liveness, @Readiness, @Startup have the right semantics for my use case. The application is considered "alive" and "ready" even without the Kafka connection or if consumers temporarily stop processing records. Hence, it should not be restarted right away just because my health check would report DOWN.


Solution

  • In Quarkus, with SmallRye Health, we got you covered :)

    Either Wellness - https://smallrye.io/docs/smallrye-health/3.0.1/wellness.html or as we later extended this idea -- HealthGroup(s) - https://smallrye.io/docs/smallrye-health/3.0.1/health-groups.html.