Class AbstractReactiveHealthIndicator
java.lang.Object
org.springframework.boot.health.contributor.AbstractReactiveHealthIndicator
- All Implemented Interfaces:
ReactiveHealthContributor, ReactiveHealthIndicator
- Direct Known Subclasses:
CassandraDriverReactiveHealthIndicator, ConnectionFactoryHealthIndicator, CouchbaseReactiveHealthIndicator, DataElasticsearchReactiveHealthIndicator, DataRedisReactiveHealthIndicator, MongoReactiveHealthIndicator, Neo4jReactiveHealthIndicator
public abstract class AbstractReactiveHealthIndicator
extends Object
implements ReactiveHealthIndicator
Base
ReactiveHealthIndicator implementations that encapsulates creation of
Health instance and error handling.- Since:
- 4.0.0
- Author:
- Stephane Nicoll, Nikolay Rybak, Moritz Halbritter
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreate a newAbstractReactiveHealthIndicatorinstance with a defaulthealthCheckFailedMessage.protectedAbstractReactiveHealthIndicator(@Nullable String healthCheckFailedMessage) Create a newAbstractReactiveHealthIndicatorinstance with a specific message to log when the health check fails.protectedAbstractReactiveHealthIndicator(Function<Throwable, @Nullable String> healthCheckFailedMessage) Create a newAbstractReactiveHealthIndicatorinstance with a specific message to log when the health check fails. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract reactor.core.publisher.Mono<Health> doHealthCheck(Health.Builder builder) Actual health check logic.final reactor.core.publisher.Mono<Health> health()Provide the indicator of health.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ReactiveHealthIndicator
asHealthContributor, health
-
Constructor Details
-
AbstractReactiveHealthIndicator
protected AbstractReactiveHealthIndicator()Create a newAbstractReactiveHealthIndicatorinstance with a defaulthealthCheckFailedMessage. -
AbstractReactiveHealthIndicator
Create a newAbstractReactiveHealthIndicatorinstance with a specific message to log when the health check fails.- Parameters:
healthCheckFailedMessage- the message to log on health check failure
-
AbstractReactiveHealthIndicator
protected AbstractReactiveHealthIndicator(Function<Throwable, @Nullable String> healthCheckFailedMessage) Create a newAbstractReactiveHealthIndicatorinstance with a specific message to log when the health check fails.- Parameters:
healthCheckFailedMessage- the message to log on health check failure
-
-
Method Details
-
health
Description copied from interface:ReactiveHealthIndicatorProvide the indicator of health.- Specified by:
healthin interfaceReactiveHealthIndicator- Returns:
- a
Monothat provides theHealth
-
doHealthCheck
Actual health check logic. If an error occurs in the pipeline, it will be handled automatically.- Parameters:
builder- theHealth.Builderto report health status and details- Returns:
- a
Monothat provides theHealth
-