Skip to content

Add HealthIndicator support for Apache Pulsar #51706

Description

@rahulyadav84

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: team-onlyAn issue that's best handled directly by the team rather than a community contribution.type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions