Class ElasticsearchHealthIndicator
- java.lang.Object
-
- io.micronaut.elasticsearch.health.ElasticsearchHealthIndicator
-
- All Implemented Interfaces:
io.micronaut.core.order.Ordered,io.micronaut.management.health.indicator.HealthIndicator
@Requires(beans=io.micronaut.management.endpoint.health.HealthEndpoint.class) @Requires(property="endpoints.health.elasticsearch.rest.high.level.enabled",notEquals="false") @Singleton public class ElasticsearchHealthIndicator extends java.lang.Object implements io.micronaut.management.health.indicator.HealthIndicatorAHealthIndicatorfor Elasticsearch that uses an automatically-configured high-level REST client, injected as a dependency, to communicate with Elasticsearch.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description ElasticsearchHealthIndicator(org.elasticsearch.client.RestHighLevelClient esClient)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.reactivestreams.Publisher<io.micronaut.management.health.indicator.HealthResult>getResult()Tries to call the cluster info API on Elasticsearch to obtain information about the cluster.
-
-
-
Method Detail
-
getResult
public org.reactivestreams.Publisher<io.micronaut.management.health.indicator.HealthResult> getResult()
Tries to call the cluster info API on Elasticsearch to obtain information about the cluster. If the call succeeds, the Elasticsearch cluster health status (GREEN / YELLOW / RED) will be included in the health indicator details.- Specified by:
getResultin interfaceio.micronaut.management.health.indicator.HealthIndicator- Returns:
- A positive health result UP if the cluster can be communicated with and is in either GREEN or YELLOW status. A negative health result DOWN if the cluster cannot be communicated with or is in RED status.
-
-