Commit b0aba9ed authored by Stephane Nicoll's avatar Stephane Nicoll

Document how to register a blocking health contributor with reactive

Closes gh-19707
parent 06e5b0e9
...@@ -794,7 +794,8 @@ For reactive applications, such as those using Spring WebFlux, `ReactiveHealthIn ...@@ -794,7 +794,8 @@ For reactive applications, such as those using Spring WebFlux, `ReactiveHealthIn
Similar to a traditional `HealthIndicator`, health information is collected from the content of a {spring-boot-actuator-module-code}/health/ReactiveHealthIndicatorRegistry.java[`ReactiveHealthIndicatorRegistry`] (by default all {spring-boot-actuator-module-code}/health/HealthIndicator.java[`HealthIndicator`] and {spring-boot-actuator-module-code}/health/ReactiveHealthIndicator.java[`ReactiveHealthIndicator`] instances defined in your `ApplicationContext`. Similar to a traditional `HealthIndicator`, health information is collected from the content of a {spring-boot-actuator-module-code}/health/ReactiveHealthIndicatorRegistry.java[`ReactiveHealthIndicatorRegistry`] (by default all {spring-boot-actuator-module-code}/health/HealthIndicator.java[`HealthIndicator`] and {spring-boot-actuator-module-code}/health/ReactiveHealthIndicator.java[`ReactiveHealthIndicator`] instances defined in your `ApplicationContext`.
Regular `HealthIndicator` that do not check against a reactive API are executed on the elastic scheduler. Regular `HealthIndicator` that do not check against a reactive API are executed on the elastic scheduler.
TIP: In a reactive application, The `ReactiveHealthIndicatorRegistry` can be used to register and unregister health indicators at runtime. TIP: In a reactive application, The `ReactiveHealthIndicatorRegistry` should be used to register and unregister health indicators at runtime.
If you need to register a regular `HealthIndicator`, you should wrap it using `HealthIndicatorReactiveAdapter`.
To provide custom health information from a reactive API, you can register Spring beans that implement the {spring-boot-actuator-module-code}/health/ReactiveHealthIndicator.java[`ReactiveHealthIndicator`] interface. To provide custom health information from a reactive API, you can register Spring beans that implement the {spring-boot-actuator-module-code}/health/ReactiveHealthIndicator.java[`ReactiveHealthIndicator`] interface.
The following code shows a sample `ReactiveHealthIndicator` implementation: The following code shows a sample `ReactiveHealthIndicator` implementation:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment