Health Checks

Since Camel 2.20

Camel provides support to probe the state of an integration via a pluggable Health Check strategy based on the following concepts:

  • HealthCheck: represents a health check and defines its basic contract;

  • HealthCheckResponse: represents a health check invocation response;

  • HealthCheckConfiguration: a basic configuration object that holds some basic settings like the minimum delay between calls, the number of times a service may be reported as unhealthy before marking the check as failed; besides these simple options, the check implementation is responsible for implementing further limitations where needed;

  • HealthCheckRegistry: a registry for health checks;

  • HealthCheckRepository: a simple interface to define health check providers. By default there is one that grabs all the checks available in the registry so you can add your own check i.e. istantiating your bean in spring/spring-boot; components can provide their own repository;

  • HealthCheckService: a simple service that runs in the background and invokes the checks according to a schedule;


  • Spring Boot:

    # Enable route checks = true
    # Configure default thresholds = 10
    # Configure a different exchanges-failed  threshold for the route bar[bar].exchanges-failed = 20
    # Configure different thresholds for the route slow without inherit global
    # thresholds[slow].inherit = false[slow].last-processing-time.threshold = 1s[slow].last-processing-time.failures = 5
  • Spring XML DSL:

    <beans xmlns=""
          This repository will automatically be added to Camel's health check
          repository list.
      <bean id="hc-repo-routes" class="">
        <property name="evaluators">
                Set the checks that will be applied to every route if no per route
                configuration is defined, see below.
            <bean class="">
              <constructor-arg value="10"/>
            <bean class="">
              <constructor-arg value="1000"/>
              <constructor-arg value="1"/>
        <property name="routesEvaluators">
                Set the checks to be associated with the route named route-1, note that
                default checks are not inherit so there will be only one check for this
            <entry key="route-1">
                <bean class="">
                  <constructor-arg value="10"/>
      <camelContext xmlns="">

Writing a custom check:

As of version 2.20.0, there are a limited number of health checks provided by Camel out of the box, so you may need to write your own check which you can do by implementing the HealthCheck interface or by extending AbstractHealthCheck which provides some usueful methods:

public final class MyHealthCheck extends AbstractHealthCheck {
    public ContextHealthCheck() {
        super("camel", "my-check");

        // make this check enabled by default

    protected void doCall(HealthCheckResultBuilder builder, Map<String, Object> options) {
        // Default value

        // Add some details to the check result
        builder.detail("my.detail", camelContext.getName());

        if (unhealtyCondition) {
        } else {

You can now make MyHealthCheck available to camel by adding an instance to the application context (Spring, Blueprint) or directly to the registry.