Adding docs for ReactorKafkaBinderHealthIndicator

See https://github.com/spring-cloud/spring-cloud-stream/issues/2948
This commit is contained in:
Soby Chacko
2024-05-13 16:08:02 -04:00
parent a89331c095
commit 7e20c9efbe
2 changed files with 20 additions and 0 deletions

View File

@@ -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[]

View File

@@ -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();
----