Motivation
Spring Boot auto-configures Actuator HealthIndicators for a number of messaging and data infrastructure clients when they're on the classpath, including Redis, JDBC DataSource, MongoDB, Elasticsearch, and others. PulsarAutoConfiguration already auto-configures a PulsarClient and a PulsarAdministration bean, but there is no corresponding health indicator, so applications using spring-boot-starter-pulsar have no built-in way to expose the health of their Pulsar cluster through /actuator/health.
Problem
Without a PulsarHealthIndicator, teams running Pulsar-backed services must either write their own custom HealthIndicator, or go without cluster-health visibility in the Actuator health endpoint, unlike users of Redis, JDBC, MongoDB, etc. This is an inconsistency in an otherwise broad set of auto-configured health indicators.
Proposed Solution
Add a PulsarHealthIndicator (org.springframework.boot.pulsar.health) that performs a broker healthcheck through the already auto-configured PulsarAdministration client (PulsarAdmin.brokers().healthcheckAsync(), bounded by a configurable timeout), reporting UP/DOWN accordingly. Wire it up with a PulsarHealthContributorAutoConfiguration (org.springframework.boot.pulsar.autoconfigure.health), conditional on PulsarAdministration being on the classpath and present as a bean, and on spring-boot-actuator being present -- following Spring Boot's standard health-indicator auto-configuration conventions (@ConditionalOnClass/@ConditionalOnBean/@ConditionalOnEnabledHealthIndicator("pulsar")).
I already have a working prototype of this (indicator, auto-configuration, unit tests for the UP/DOWN/timeout cases, and documentation updates to the Pulsar reference page and the Actuator health-indicators table) and I'm happy to submit it as a PR once the general direction is confirmed by a maintainer.
Motivation
Spring Boot auto-configures Actuator
HealthIndicators for a number of messaging and data infrastructure clients when they're on the classpath, including Redis, JDBCDataSource, MongoDB, Elasticsearch, and others.PulsarAutoConfigurationalready auto-configures aPulsarClientand aPulsarAdministrationbean, but there is no corresponding health indicator, so applications usingspring-boot-starter-pulsarhave no built-in way to expose the health of their Pulsar cluster through/actuator/health.Problem
Without a
PulsarHealthIndicator, teams running Pulsar-backed services must either write their own customHealthIndicator, or go without cluster-health visibility in the Actuator health endpoint, unlike users of Redis, JDBC, MongoDB, etc. This is an inconsistency in an otherwise broad set of auto-configured health indicators.Proposed Solution
Add a
PulsarHealthIndicator(org.springframework.boot.pulsar.health) that performs a broker healthcheck through the already auto-configuredPulsarAdministrationclient (PulsarAdmin.brokers().healthcheckAsync(), bounded by a configurable timeout), reportingUP/DOWNaccordingly. Wire it up with aPulsarHealthContributorAutoConfiguration(org.springframework.boot.pulsar.autoconfigure.health), conditional onPulsarAdministrationbeing on the classpath and present as a bean, and onspring-boot-actuatorbeing present -- following Spring Boot's standard health-indicator auto-configuration conventions (@ConditionalOnClass/@ConditionalOnBean/@ConditionalOnEnabledHealthIndicator("pulsar")).I already have a working prototype of this (indicator, auto-configuration, unit tests for the UP/DOWN/timeout cases, and documentation updates to the Pulsar reference page and the Actuator health-indicators table) and I'm happy to submit it as a PR once the general direction is confirmed by a maintainer.