Class ActuatorHealthApplicationStatusProvider

java.lang.Object
org.springframework.cloud.consul.serviceregistry.ActuatorHealthApplicationStatusProvider
All Implemented Interfaces:
ApplicationStatusProvider

public class ActuatorHealthApplicationStatusProvider extends Object implements ApplicationStatusProvider
Leverages Spring Boot Actuator health endpoint to determine the current health of the application.
Author:
Chris Bono
  • Constructor Summary

    Constructors
    Constructor
    Description
    ActuatorHealthApplicationStatusProvider(org.springframework.boot.actuate.health.HealthEndpoint healthEndpoint, HeartbeatProperties heartbeatProperties)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.ecwid.consul.v1.health.model.Check.CheckStatus
    Gets the current actuator health status and converts to Consul check status using the following mapping: Status.UP -> Check.CheckStatus.PASSING Status.DOWN or Status.OUT_OF_SERVICE -> Check.CheckStatus.CRITICAL Otherwise Check.CheckStatus.UNKNOWN .

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ActuatorHealthApplicationStatusProvider

      public ActuatorHealthApplicationStatusProvider(org.springframework.boot.actuate.health.HealthEndpoint healthEndpoint, HeartbeatProperties heartbeatProperties)
  • Method Details

    • currentStatus

      public com.ecwid.consul.v1.health.model.Check.CheckStatus currentStatus()
      Gets the current actuator health status and converts to Consul check status using the following mapping:
      • Status.UP -> Check.CheckStatus.PASSING
      • Status.DOWN or Status.OUT_OF_SERVICE -> Check.CheckStatus.CRITICAL
      • Otherwise Check.CheckStatus.UNKNOWN
      .
      Specified by:
      currentStatus in interface ApplicationStatusProvider
      Returns:
      the check status based on the actuator health status (see above for mapping)