Search in sources :

Example 1 with Row

use of io.vertx.reactivex.sqlclient.Row in project micronaut-sql by micronaut-projects.

the class PgHealthIndicator method getResult.

@Override
public Publisher<HealthResult> getResult() {
    return client.query(QUERY).rxExecute().map(rows -> {
        HealthResult.Builder status = HealthResult.builder(NAME, HealthStatus.UP);
        Row row = rows.iterator().next();
        status.details(Collections.singletonMap("version", row.getString(0)));
        return status.build();
    }).onErrorReturn(this::buildErrorResult).toFlowable();
}
Also used : Row(io.vertx.reactivex.sqlclient.Row) HealthResult(io.micronaut.management.health.indicator.HealthResult)

Example 2 with Row

use of io.vertx.reactivex.sqlclient.Row in project micronaut-sql by micronaut-projects.

the class MySQLHealthIndicator method getResult.

@Override
public Publisher<HealthResult> getResult() {
    return client.query(QUERY).rxExecute().map(rows -> {
        HealthResult.Builder status = HealthResult.builder(NAME, HealthStatus.UP);
        Row row = rows.iterator().next();
        status.details(Collections.singletonMap("version", row.getString(0)));
        return status.build();
    }).onErrorReturn(this::buildErrorResult).toFlowable();
}
Also used : Row(io.vertx.reactivex.sqlclient.Row) HealthResult(io.micronaut.management.health.indicator.HealthResult)

Aggregations

HealthResult (io.micronaut.management.health.indicator.HealthResult)2 Row (io.vertx.reactivex.sqlclient.Row)2