Class ConnectionFactoryHealthIndicator
java.lang.Object
org.springframework.boot.actuate.health.AbstractReactiveHealthIndicator
org.springframework.boot.actuate.r2dbc.ConnectionFactoryHealthIndicator
- All Implemented Interfaces:
ReactiveHealthContributor
,ReactiveHealthIndicator
A
HealthIndicator
to validate a R2DBC ConnectionFactory
.- Since:
- 2.3.0
- Author:
- Mark Paluch, Stephane Nicoll
-
Constructor Summary
ConstructorDescriptionConnectionFactoryHealthIndicator
(io.r2dbc.spi.ConnectionFactory connectionFactory) Create a newConnectionFactoryHealthIndicator
using the specifiedConnectionFactory
and no validation query.ConnectionFactoryHealthIndicator
(io.r2dbc.spi.ConnectionFactory connectionFactory, String validationQuery) Create a newConnectionFactoryHealthIndicator
using the specifiedConnectionFactory
and 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 org.springframework.boot.actuate.health.AbstractReactiveHealthIndicator
health
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.boot.actuate.health.ReactiveHealthIndicator
getHealth
-
Constructor Details
-
ConnectionFactoryHealthIndicator
public ConnectionFactoryHealthIndicator(io.r2dbc.spi.ConnectionFactory connectionFactory) Create a newConnectionFactoryHealthIndicator
using the specifiedConnectionFactory
and no validation query.- Parameters:
connectionFactory
- the connection factory- See Also:
-
Connection.validate(ValidationDepth)
-
ConnectionFactoryHealthIndicator
public ConnectionFactoryHealthIndicator(io.r2dbc.spi.ConnectionFactory connectionFactory, String validationQuery) Create a newConnectionFactoryHealthIndicator
using the specifiedConnectionFactory
and validation query.- Parameters:
connectionFactory
- the connection factoryvalidationQuery
- the validation query, can benull
to use connection validation
-
-
Method Details
-
doHealthCheck
Description copied from class:AbstractReactiveHealthIndicator
Actual health check logic. If an error occurs in the pipeline, it will be handled automatically.- Specified by:
doHealthCheck
in classAbstractReactiveHealthIndicator
- Parameters:
builder
- theHealth.Builder
to report health status and details- Returns:
- a
Mono
that provides theHealth
-