This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 35eea91 camel-health - Update docs
35eea91 is described below
commit 35eea9156d9828363825de3a12cc2ebd8dfeef27
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Jun 1 10:39:58 2020 +0200
camel-health - Update docs
---
.../modules/others/pages/microprofile-health.adoc | 1 -
.../modules/ROOT/pages/health-check.adoc | 87 +---------------------
2 files changed, 3 insertions(+), 85 deletions(-)
diff --git a/docs/components/modules/others/pages/microprofile-health.adoc
b/docs/components/modules/others/pages/microprofile-health.adoc
index 1a3d105..43b14ac 100644
--- a/docs/components/modules/others/pages/microprofile-health.adoc
+++ b/docs/components/modules/others/pages/microprofile-health.adoc
@@ -40,7 +40,6 @@ public class MyHealthCheck extends
AbstractCamelMicroProfileLivenessCheck {
public MyHealthCheck() {
super("my-liveness-check-id");
- getConfiguration().setEnabled(true);
}
@Override
diff --git a/docs/user-manual/modules/ROOT/pages/health-check.adoc
b/docs/user-manual/modules/ROOT/pages/health-check.adoc
index a18d05b..2c26a70 100644
--- a/docs/user-manual/modules/ROOT/pages/health-check.adoc
+++ b/docs/user-manual/modules/ROOT/pages/health-check.adoc
@@ -10,99 +10,18 @@ Camel provides support to probe the state of an integration
via a pluggable Heal
- *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;
-== Examples:
-
-- *Spring Boot*:
-+
-[source,properties]
-----
-# Enable route checks
-camel.health.check.routes.enabled = true
-
-# Configure default thresholds
-camel.health.check.routes.thresholds.exchanges-failed = 10
-
-# Configure a different exchanges-failed threshold for the route bar
-camel.health.check.routes.threshold[bar].exchanges-failed = 20
-
-# Configure different thresholds for the route slow without inherit global
-# thresholds
-camel.health.check.routes.threshold[slow].inherit = false
-camel.health.check.routes.threshold[slow].last-processing-time.threshold = 1s
-camel.health.check.routes.threshold[slow].last-processing-time.failures = 5
-----
-
-- *Spring XML DSL*:
-+
-[source,xml]
-----
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://camel.apache.org/schema/spring
- http://camel.apache.org/schema/spring/camel-spring.xsd">
-
- <!--
- This repository will automatically be added to Camel's health check
- repository list.
- -->
- <bean id="hc-repo-routes"
class="org.apache.camel.impl.health.RoutesHealthCheckRepository">
- <property name="evaluators">
- <list>
- <!--
- Set the checks that will be applied to every route if no per route
- configuration is defined, see below.
- -->
- <bean
class="org.apache.camel.impl.health.RoutePerformanceCounterEvaluators.ExchangesFailed">
- <constructor-arg value="10"/>
- </bean>
- <bean
class="org.apache.camel.impl.health.RoutePerformanceCounterEvaluators.LastProcessingTime">
- <constructor-arg value="1000"/>
- <constructor-arg value="1"/>
- </bean>
- </list>
- </property>
- <property name="routesEvaluators">
- <map>
- <!--
- 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
- route.
- -->
- <entry key="route-1">
- <list>
- <bean
class="org.apache.camel.impl.health.RoutePerformanceCounterEvaluators.ExchangesInflight">
- <constructor-arg value="10"/>
- </bean>
- </list>
- </entry>
- </map>
- </property>
- </bean>
-
- <camelContext xmlns="http://camel.apache.org/schema/spring">
- ...
- </camelContext>
-
-</beans>
-----
== Writing a custom check:
-As of version 2.20, 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:
+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 useful methods:
[source,java]
----
public final class MyHealthCheck extends AbstractHealthCheck {
- public ContextHealthCheck() {
- super("camel", "my-check");
- // make this check enabled by default
- getConfiguration().setEnabled(true);
+ public MyHealthCheck() {
+ super("camel", "my-check");
}
@Override