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
ConstructorsConstructorDescriptionActuatorHealthApplicationStatusProvider(org.springframework.boot.actuate.health.HealthEndpoint healthEndpoint, HeartbeatProperties heartbeatProperties) -
Method Summary
Modifier and TypeMethodDescriptioncom.ecwid.consul.v1.health.model.Check.CheckStatusGets the current actuator health status and converts to Consul check status using the following mapping:Status.UP->Check.CheckStatus.PASSINGStatus.DOWNorStatus.OUT_OF_SERVICE->Check.CheckStatus.CRITICALOtherwiseCheck.CheckStatus.UNKNOWN.
-
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.PASSINGStatus.DOWNorStatus.OUT_OF_SERVICE->Check.CheckStatus.CRITICAL- Otherwise
Check.CheckStatus.UNKNOWN
- Specified by:
currentStatusin interfaceApplicationStatusProvider- Returns:
- the check status based on the actuator health status (see above for mapping)
-