Class AbstractReactiveHealthIndicator

java.lang.Object
org.springframework.boot.actuate.health.AbstractReactiveHealthIndicator
All Implemented Interfaces:
ReactiveHealthContributor, ReactiveHealthIndicator
Direct Known Subclasses:
CassandraDriverReactiveHealthIndicator, ConnectionFactoryHealthIndicator, CouchbaseReactiveHealthIndicator, ElasticsearchReactiveHealthIndicator, MongoReactiveHealthIndicator, Neo4jReactiveHealthIndicator, RedisReactiveHealthIndicator

public abstract class AbstractReactiveHealthIndicator extends Object implements ReactiveHealthIndicator
Base ReactiveHealthIndicator implementations that encapsulates creation of Health instance and error handling.
Since:
2.0.0
Author:
Stephane Nicoll, Nikolay Rybak
  • Constructor Details

    • AbstractReactiveHealthIndicator

      protected AbstractReactiveHealthIndicator()
      Create a new AbstractReactiveHealthIndicator instance with a default healthCheckFailedMessage.
      Since:
      2.1.7
    • AbstractReactiveHealthIndicator

      protected AbstractReactiveHealthIndicator(String healthCheckFailedMessage)
      Create a new AbstractReactiveHealthIndicator instance with a specific message to log when the health check fails.
      Parameters:
      healthCheckFailedMessage - the message to log on health check failure
      Since:
      2.1.7
    • AbstractReactiveHealthIndicator

      protected AbstractReactiveHealthIndicator(Function<Throwable,String> healthCheckFailedMessage)
      Create a new AbstractReactiveHealthIndicator instance with a specific message to log when the health check fails.
      Parameters:
      healthCheckFailedMessage - the message to log on health check failure
      Since:
      2.1.7
  • Method Details

    • health

      public final reactor.core.publisher.Mono<Health> health()
      Description copied from interface: ReactiveHealthIndicator
      Provide the indicator of health.
      Specified by:
      health in interface ReactiveHealthIndicator
      Returns:
      a Mono that provides the Health
    • doHealthCheck

      protected abstract reactor.core.publisher.Mono<Health> doHealthCheck(Health.Builder builder)
      Actual health check logic. If an error occurs in the pipeline it will be handled automatically.
      Parameters:
      builder - the Health.Builder to report health status and details
      Returns:
      a Mono that provides the Health