Document how to register a blocking health contributor with reactive

Closes gh-19707
This commit is contained in:
Stephane Nicoll 2020-02-11 14:22:16 +01:00
parent 06e5b0e912
commit b0aba9ed67

View File

@ -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`.
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.
The following code shows a sample `ReactiveHealthIndicator` implementation: