You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/07/28 12:52:26 UTC

[camel] 06/06: CAMEL-19645: producer based health checks is disabled by default.

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch hc-producer-disabled
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 002a5b6d880ab538ddd090af3d5d6fdcac9eaa24
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Jul 28 14:51:50 2023 +0200

    CAMEL-19645: producer based health checks is disabled by default.
---
 .../ROOT/pages/camel-4-migration-guide.adoc        |  5 ++-
 .../modules/ROOT/pages/health-check.adoc           | 42 ++++++++++++++++++----
 2 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc b/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc
index 8a219d07862..c08dc3f2c3e 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc
@@ -160,14 +160,13 @@ To continue this behaviour in Camel 4, then producer based health checks are dis
 Notice that `camel-kafka` comes with producer based health-check that worked in Camel 3,
 and therefore this change in Camel 4, means that this health-check is disabled.
 
-You can enable producer health-checks per component via
+You *MUST* enable producer health-checks globally, such as in `application.properties`:
 
 [source,properties]
 ----
-camel.component.kafka.health-check-producer-enabled = true
+camel.health.producers-enabled = true
 ----
 
-
 == JMX
 
 Camel now also include MBeans for `doCatch` and `doFinally` in the tree of processor MBeans.
diff --git a/docs/user-manual/modules/ROOT/pages/health-check.adoc b/docs/user-manual/modules/ROOT/pages/health-check.adoc
index 73d6f139db8..870a259511e 100644
--- a/docs/user-manual/modules/ROOT/pages/health-check.adoc
+++ b/docs/user-manual/modules/ROOT/pages/health-check.adoc
@@ -24,6 +24,9 @@ Camel provides the following health checks out of the box:
   then the consumer is UP. This is on purpose to avoid having the health check to be initially UP
   and then after first poll run then DOWN again because the consumer cannot poll from external system;
   which causes the health check to be _flaky_.
+- _producers_ A `HealthCheckRegistry` which are for producer based health-checks. There are a few components
+  which comes with producer health checks such as `camel-kafka` and many of the `AWS` components.
+  However, producer health checks are by default disabled. See further below for how to enable producer health checks.
 - _registry_ - A `HealthCheckRegistry` which discovers all the available custom `HealthCheck` instances in the `Registry`.
 
 == IDs
@@ -56,8 +59,10 @@ public boolean isReadiness() {
 Camel supports via `camel-main` to configure health-checks from configuration files. This is possible for runtimes that leverage `camel-main`
 such as Camel on Spring Boot, or Camel K.
 
-Camel will automatically enable `context`, `routes`, `consumers`, and `registry` health-checks if `camel-health` is detected on the classpath.
-They are all enabled by default (context is always enabled and cannot be disabled). However, you can configure them, for example to turn them off:
+Camel will automatically enable `context`, `routes`, `consumers`, `producers` and `registry` health-checks if `camel-health` is detected on the classpath.
+They are all enabled by default (except for `producers` which is disabled).
+
+However, you can configure them, for example to turn them off:
 
 [source,properties]
 ----
@@ -110,24 +115,47 @@ camel.health.exclude-pattern = consumer:myroute*
 
 which will turn off checks for all consumers on routes that starts with `myroute` in the route ID.
 
-=== Turning off health checks from components
 
-Some Camel components comes with health-checks.
+Or you can turn off producer based health checks by their component name:
+
+[source,properties]
+----
+camel.health.exclude-pattern = producer:kafka*
+----
 
-For example to turn off all health checks from the Kafka component you can do:
+Or all AWS producer health-checks
 
 [source,properties]
 ----
-camel.component.kafka.health-check-enabled = false
+camel.health.exclude-pattern = producer:aws*
 ----
 
-You can also turn off only consumer or producer based checks:
+=== Turning on producer level health-checks
+
+Only consumer based health-checks is enabled by default.
+
+Some components (in particular AWS) provides also health checks for producers.
+These health checks can be enabled via:
 
 [source,properties]
 ----
+camel.health.producersEnabled=true
+----
+
+=== Turning off health checks from components
+
+Some Camel components comes with health-checks.
+
+For example to turn off both consumer and producer health checks from Kafka:
+
+[source,properties]
+----
+camel.component.kafka.health-check-consumer-enabled = false
 camel.component.kafka.health-check-producer-enabled = false
 ----
 
+TIP: You can turn of either consumer, producer or both.
+
 == JMX management
 
 The health check is manageable via JMX (requires `camel-management` JAR on the classpath).