Package io.micronaut.r2dbc.health
Class R2dbcHealthIndicator
java.lang.Object
io.micronaut.r2dbc.health.R2dbcHealthIndicator
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,io.micronaut.management.health.indicator.HealthIndicator
@Requires(classes=io.micronaut.management.health.indicator.HealthIndicator.class) @Requires(beans=io.r2dbc.spi.ConnectionFactory.class) @Requires(property="endpoints.health.r2dbc.enabled",value="true",defaultValue="true")
@EachBean(io.r2dbc.spi.ConnectionFactory.class)
public class R2dbcHealthIndicator
extends Object
implements io.micronaut.management.health.indicator.HealthIndicator
Supports R2DBC Connection Factory health check.
- Since:
- 2.1.0
- Author:
- Anton Kurako (GoodforGod)
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionR2dbcHealthIndicator
(io.r2dbc.spi.ConnectionFactory connectionFactory, R2dbcHealthConfiguration healthConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionextractQueryResult
(io.r2dbc.spi.Row row, io.r2dbc.spi.RowMetadata metadata) org.reactivestreams.Publisher<io.micronaut.management.health.indicator.HealthResult>
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Constructor Details
-
R2dbcHealthIndicator
@Inject public R2dbcHealthIndicator(io.r2dbc.spi.ConnectionFactory connectionFactory, R2dbcHealthConfiguration healthConfiguration)
-
-
Method Details
-
getResult
public org.reactivestreams.Publisher<io.micronaut.management.health.indicator.HealthResult> getResult()- Specified by:
getResult
in interfaceio.micronaut.management.health.indicator.HealthIndicator
-
extractQueryResult
protected Map<String,Object> extractQueryResult(io.r2dbc.spi.Row row, io.r2dbc.spi.RowMetadata metadata) - Parameters:
row
- to extract metadata for healthmetadata
- for row available for extraction row data- Returns:
- metadata as string
-