Class ConnectionFactoryHealthIndicator
java.lang.Object
org.springframework.boot.health.contributor.AbstractReactiveHealthIndicator
org.springframework.boot.r2dbc.health.ConnectionFactoryHealthIndicator
- All Implemented Interfaces:
ReactiveHealthContributor, ReactiveHealthIndicator
A
HealthIndicator to validate a R2DBC ConnectionFactory.- Since:
- 4.0.0
- Author:
- Mark Paluch, Stephane Nicoll
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionFactoryHealthIndicator(io.r2dbc.spi.ConnectionFactory connectionFactory) Create a newConnectionFactoryHealthIndicatorusing the specifiedConnectionFactoryand no validation query.ConnectionFactoryHealthIndicator(io.r2dbc.spi.ConnectionFactory connectionFactory, @Nullable String validationQuery) Create a newConnectionFactoryHealthIndicatorusing the specifiedConnectionFactoryand validation query. -
Method Summary
Modifier and TypeMethodDescriptionprotected final reactor.core.publisher.Mono<Health> doHealthCheck(Health.Builder builder) Actual health check logic.Methods inherited from class AbstractReactiveHealthIndicator
healthMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ReactiveHealthIndicator
asHealthContributor, health
-
Constructor Details
-
ConnectionFactoryHealthIndicator
public ConnectionFactoryHealthIndicator(io.r2dbc.spi.ConnectionFactory connectionFactory) Create a newConnectionFactoryHealthIndicatorusing the specifiedConnectionFactoryand no validation query.- Parameters:
connectionFactory- the connection factory- See Also:
-
ConnectionFactoryHealthIndicator
public ConnectionFactoryHealthIndicator(io.r2dbc.spi.ConnectionFactory connectionFactory, @Nullable String validationQuery) Create a newConnectionFactoryHealthIndicatorusing the specifiedConnectionFactoryand validation query.- Parameters:
connectionFactory- the connection factoryvalidationQuery- the validation query, can benullto use connection validation
-
-
Method Details
-
doHealthCheck
Description copied from class:AbstractReactiveHealthIndicatorActual health check logic. If an error occurs in the pipeline, it will be handled automatically.- Specified by:
doHealthCheckin classAbstractReactiveHealthIndicator- Parameters:
builder- theHealth.Builderto report health status and details- Returns:
- a
Monothat provides theHealth
-