From 7e20c9efbe7521a32ca81aff4745c081e5c0bb96 Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Mon, 13 May 2024 16:08:02 -0400 Subject: [PATCH] Adding docs for `ReactorKafkaBinderHealthIndicator` See https://github.com/spring-cloud/spring-cloud-stream/issues/2948 --- docs/modules/ROOT/nav.adoc | 1 + .../health_indicator.adoc | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 docs/modules/ROOT/pages/kafka/kafka-reactive-binder/health_indicator.adoc diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index c325f810b..11ddd7872 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -73,6 +73,7 @@ **** xref:kafka/kafka-reactive-binder/multiplex.adoc[] **** xref:kafka/kafka-reactive-binder/pattern.adoc[] **** xref:kafka/kafka-reactive-binder/sender_result.adoc[] +**** xref:kafka/kafka-reactive-binder/health_indicator.adoc[] *** Kafka Stream Binder **** xref:kafka/kafka-streams-binder/usage.adoc[] **** xref:kafka/kafka-streams-binder/overview.adoc[] diff --git a/docs/modules/ROOT/pages/kafka/kafka-reactive-binder/health_indicator.adoc b/docs/modules/ROOT/pages/kafka/kafka-reactive-binder/health_indicator.adoc new file mode 100644 index 000000000..92e5952d4 --- /dev/null +++ b/docs/modules/ROOT/pages/kafka/kafka-reactive-binder/health_indicator.adoc @@ -0,0 +1,19 @@ +[[reactor-kafka-binder-health-indicator]] += Reactor Kafka Binder Health Indicator + +Reactor Kafka binder provides a `HealthIndicator` implementation that will be used when invoking the Spring Boot Actuator `health` endpoint. +When Spring Boot actuator dependency is on the classpath, the Reactor Kafka binder can be enabled with a binder health indicator. +This health indicator provides information about the status of the binder based application, i.e. if it is currently `UP` or `DOWN`, the topics in usage by the application, and the various details about the message producer components that the binder uses internally. + + +The Reactor Kafka Binder Health Indicator is registered with the key `reactorKafka` internally by the framework. +Therefore, it can be queried programmatically as shown below. + +[source, java] +---- +CompositeHealthContributor compositeHealthContributor = context + .getBean("bindersHealthContributor", CompositeHealthContributor.class); +ReactorKafkaBinderHealthIndicator healthIndicator = (ReactorKafkaBinderHealthIndicator) compositeHealthContributor.getContributor("reactorKafka"); +Health health = healthIndicator.health(); +---- +