Class OpenSearchClientHealthIndicator

java.lang.Object
io.micronaut.opensearch.health.OpenSearchClientHealthIndicator
All Implemented Interfaces:
io.micronaut.core.order.Ordered, io.micronaut.management.health.indicator.HealthIndicator

@Singleton public class OpenSearchClientHealthIndicator extends Object implements io.micronaut.management.health.indicator.HealthIndicator
Health indicator integration for the configured OpenSearch cluster.
  • Field Summary

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    OpenSearchClientHealthIndicator(org.opensearch.client.opensearch.OpenSearchAsyncClient client)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.reactivestreams.Publisher<io.micronaut.management.health.indicator.HealthResult>
    Tries to call the cluster info API on OpenSearch to obtain information about the cluster.

    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

    • OpenSearchClientHealthIndicator

      public OpenSearchClientHealthIndicator(org.opensearch.client.opensearch.OpenSearchAsyncClient client)
      Constructor.
      Parameters:
      client - The OpenSearch high level REST client.
  • Method Details

    • getResult

      public org.reactivestreams.Publisher<io.micronaut.management.health.indicator.HealthResult> getResult()
      Tries to call the cluster info API on OpenSearch to obtain information about the cluster. If the call succeeds, the OpenSearch cluster health status (GREEN / YELLOW / RED) will be included in the health indicator details.
      Specified by:
      getResult in interface io.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.