Package org.apache.camel.support
Class ScheduledPollConsumerHealthCheck
- java.lang.Object
-
- org.apache.camel.support.ScheduledPollConsumerHealthCheck
-
- All Implemented Interfaces:
org.apache.camel.health.HealthCheck
,org.apache.camel.Ordered
,org.apache.camel.spi.HasGroup
,org.apache.camel.spi.HasId
public class ScheduledPollConsumerHealthCheck extends Object implements org.apache.camel.health.HealthCheck
HealthCheck
that uses the last polling state fromScheduledPollConsumer
when reporting the health.
-
-
Field Summary
-
Fields inherited from interface org.apache.camel.health.HealthCheck
CHECK_ENABLED, CHECK_GROUP, CHECK_ID, CHECK_KIND, ENDPOINT_URI, FAILURE_COUNT, FAILURE_ENDPOINT_URI, FAILURE_ERROR_COUNT, FAILURE_START_TIME, FAILURE_TIME, HTTP_RESPONSE_CODE, INVOCATION_ATTEMPT_TIME, INVOCATION_COUNT, INVOCATION_TIME, SUCCESS_COUNT, SUCCESS_START_TIME, SUCCESS_TIME
-
-
Constructor Summary
Constructors Constructor Description ScheduledPollConsumerHealthCheck(ScheduledPollConsumer consumer, String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.health.HealthCheck.Result
call(Map<String,Object> options)
String
getGroup()
String
getId()
org.apache.camel.health.HealthCheck.State
getInitialState()
boolean
isEnabled()
void
setEnabled(boolean enabled)
void
setInitialState(org.apache.camel.health.HealthCheck.State initialState)
Used to allow special consumers to override the initial state of the health check (readiness check) during startup.
-
-
-
Constructor Detail
-
ScheduledPollConsumerHealthCheck
public ScheduledPollConsumerHealthCheck(ScheduledPollConsumer consumer, String id)
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceorg.apache.camel.health.HealthCheck
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabled
in interfaceorg.apache.camel.health.HealthCheck
-
call
public org.apache.camel.health.HealthCheck.Result call(Map<String,Object> options)
- Specified by:
call
in interfaceorg.apache.camel.health.HealthCheck
-
getInitialState
public org.apache.camel.health.HealthCheck.State getInitialState()
-
setInitialState
public void setInitialState(org.apache.camel.health.HealthCheck.State initialState)
Used to allow special consumers to override the initial state of the health check (readiness check) during startup. Consumers that are internal only such as camel-scheduler uses UP as initial state because the scheduler may be configured to run only very in-frequently and therefore the overall health-check state would be affected and seen as DOWN.
-
getGroup
public String getGroup()
- Specified by:
getGroup
in interfaceorg.apache.camel.spi.HasGroup
-
getId
public String getId()
- Specified by:
getId
in interfaceorg.apache.camel.spi.HasId
-
-