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

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 9512726  CAMEL-17587: camel-health - Make Health Check API simpler
9512726 is described below

commit 9512726e41af55c39ca8567a8179383cdbe524be
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Feb 9 11:34:01 2022 +0100

    CAMEL-17587: camel-health - Make Health Check API simpler
---
 .../main/camel-main-configuration-metadata.json    |   2 +-
 .../CamelMicroProfileHealthCheckRegistry.java      |   4 +-
 .../CamelMicroProfileRepositoryHealthCheck.java    |   5 +-
 ...CamelMicroProfileHealthCheckRepositoryTest.java |  18 ----
 .../health/CamelMicroProfileHealthCheckTest.java   |   2 +-
 .../health/CamelMicroProfileHealthTestSupport.java |   5 +-
 ...nsumerHealthCheckErrorDisabledConsumerTest.java |   2 -
 .../java/org/apache/camel/health/HealthCheck.java  |  15 ++-
 .../camel/health/HealthCheckConfiguration.java     | 117 ---------------------
 .../org/apache/camel/health/HealthCheckHelper.java |   2 +-
 .../apache/camel/health/HealthCheckRegistry.java   |  17 +++
 .../apache/camel/health/HealthCheckRepository.java |  19 ----
 .../apache/camel/impl/health/HealthCheckTest.java  |   4 +-
 .../camel/impl/health/AbstractHealthCheck.java     |  23 ++--
 .../health/ConsumersHealthCheckRepository.java     |  49 +--------
 .../impl/health/DefaultHealthCheckRegistry.java    |  42 ++++++++
 .../impl/health/HealthCheckRegistryRepository.java |  48 +--------
 .../impl/health/RoutesHealthCheckRepository.java   |  49 +--------
 ...althCheckConfigurationPropertiesConfigurer.java |  55 ----------
 .../HealthConfigurationPropertiesConfigurer.java   |  21 ++--
 .../camel-main-configuration-metadata.json         |   2 +-
 ...e.camel.main.HealthCheckConfigurationProperties |   2 -
 core/camel-main/src/main/docs/main.adoc            |   2 +-
 .../org/apache/camel/main/BaseMainSupport.java     |  61 ++---------
 .../main/HealthCheckConfigurationProperties.java   |  25 -----
 .../camel/main/HealthConfigurationProperties.java  |  26 +++--
 ...ava => MainHealthCheckExcludedPatternTest.java} |  98 ++++++++++++-----
 .../camel/management/mbean/ManagedCamelHealth.java |   6 +-
 .../support/ScheduledPollConsumerHealthCheck.java  |  17 ++-
 .../ROOT/pages/camel-3x-upgrade-guide-3_16.adoc    |  28 +++++
 .../modules/ROOT/pages/health-check.adoc           |  37 ++-----
 31 files changed, 258 insertions(+), 545 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
index 0eaab4a..1d8e638 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
@@ -131,10 +131,10 @@
     { "name": "camel.faulttolerance.timeoutEnabled", "description": "Whether 
timeout is enabled or not on the circuit breaker. Default is false.", 
"sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", 
"type": "boolean", "javaType": "java.lang.Boolean", "defaultValue": false },
     { "name": "camel.faulttolerance.timeoutPoolSize", "description": 
"Configures the pool size of the thread pool when timeout is enabled. Default 
value is 10.", "sourceType": 
"org.apache.camel.main.FaultToleranceConfigurationProperties", "type": 
"integer", "javaType": "java.lang.Integer", "defaultValue": 10 },
     { "name": "camel.faulttolerance.timeoutScheduledExecutorServiceRef", 
"description": "References to a custom thread pool to use when timeout is 
enabled", "sourceType": 
"org.apache.camel.main.FaultToleranceConfigurationProperties", "type": 
"string", "javaType": "java.lang.String" },
-    { "name": "camel.health.config", "description": "Set additional 
HealthConfigurationProperties for fine grained configuration of health 
checks.", "sourceType": "org.apache.camel.main.HealthConfigurationProperties", 
"type": "object", "javaType": "java.util.Map" },
     { "name": "camel.health.consumersEnabled", "description": "Whether 
consumers health check is enabled", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties", "type": "boolean", 
"javaType": "java.lang.Boolean", "defaultValue": true },
     { "name": "camel.health.contextEnabled", "description": "Whether context 
health check is enabled", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties", "type": "boolean", 
"javaType": "java.lang.Boolean", "defaultValue": true },
     { "name": "camel.health.enabled", "description": "Whether health check is 
enabled globally", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties", "type": "boolean", 
"javaType": "java.lang.Boolean", "defaultValue": true },
+    { "name": "camel.health.excludePattern", "description": "Pattern to 
exclude health checks from being invoked by Camel when checking healths. 
Multiple patterns can be separated by comma.", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties", "type": "string", 
"javaType": "java.lang.String" },
     { "name": "camel.health.registryEnabled", "description": "Whether registry 
health check is enabled", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties", "type": "boolean", 
"javaType": "java.lang.Boolean", "defaultValue": true },
     { "name": "camel.health.routesEnabled", "description": "Whether routes 
health check is enabled", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties", "type": "boolean", 
"javaType": "java.lang.Boolean", "defaultValue": true },
     { "name": "camel.hystrix.allowMaximumSizeToDivergeFromCoreSize", 
"description": "Allows the configuration for maximumSize to take effect. That 
value can then be equal to, or higher, than coreSize", "sourceType": 
"org.apache.camel.main.HystrixConfigurationProperties", "type": "boolean", 
"javaType": "java.lang.Boolean", "defaultValue": "false", "deprecated": true },
diff --git 
a/components/camel-microprofile/camel-microprofile-health/src/main/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckRegistry.java
 
b/components/camel-microprofile/camel-microprofile-health/src/main/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckRegistry.java
index 536d843..6773cd7 100644
--- 
a/components/camel-microprofile/camel-microprofile-health/src/main/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckRegistry.java
+++ 
b/components/camel-microprofile/camel-microprofile-health/src/main/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckRegistry.java
@@ -64,7 +64,7 @@ public class CamelMicroProfileHealthCheckRegistry extends 
DefaultHealthCheckRegi
         boolean registered = super.register(obj);
         if (obj instanceof HealthCheck) {
             HealthCheck check = (HealthCheck) obj;
-            if (check.getConfiguration().isEnabled()) {
+            if (check.isEnabled()) {
                 registerMicroProfileHealthCheck(check);
             }
         } else {
@@ -134,7 +134,7 @@ public class CamelMicroProfileHealthCheckRegistry extends 
DefaultHealthCheckRegi
                 getReadinessRegistry().register(repository.getId(), 
repositoryHealthCheck);
             } else {
                 repository.stream()
-                        .filter(healthCheck -> 
healthCheck.getConfiguration().isEnabled())
+                        .filter(healthCheck -> healthCheck.isEnabled())
                         .forEach(this::registerMicroProfileHealthCheck);
             }
         }
diff --git 
a/components/camel-microprofile/camel-microprofile-health/src/main/java/org/apache/camel/microprofile/health/CamelMicroProfileRepositoryHealthCheck.java
 
b/components/camel-microprofile/camel-microprofile-health/src/main/java/org/apache/camel/microprofile/health/CamelMicroProfileRepositoryHealthCheck.java
index 4cc8530..ef614d5 100644
--- 
a/components/camel-microprofile/camel-microprofile-health/src/main/java/org/apache/camel/microprofile/health/CamelMicroProfileRepositoryHealthCheck.java
+++ 
b/components/camel-microprofile/camel-microprofile-health/src/main/java/org/apache/camel/microprofile/health/CamelMicroProfileRepositoryHealthCheck.java
@@ -17,6 +17,7 @@
 package org.apache.camel.microprofile.health;
 
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 import org.apache.camel.health.HealthCheck.Result;
@@ -49,9 +50,9 @@ final class CamelMicroProfileRepositoryHealthCheck implements 
HealthCheck {
 
         if (repository.isEnabled()) {
             List<Result> results = repository.stream()
-                    .filter(healthCheck -> 
healthCheck.getConfiguration().isEnabled())
+                    .filter(org.apache.camel.health.HealthCheck::isEnabled)
                     .map(org.apache.camel.health.HealthCheck::call)
-                    .filter(result -> result != null)
+                    .filter(Objects::nonNull)
                     .collect(Collectors.toList());
 
             // If any of the result statuses is DOWN, find the first one and 
report any error details
diff --git 
a/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckRepositoryTest.java
 
b/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckRepositoryTest.java
index 33e9ad3..41afc21 100644
--- 
a/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckRepositoryTest.java
+++ 
b/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckRepositoryTest.java
@@ -17,9 +17,7 @@
 package org.apache.camel.microprofile.health;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
-import java.util.Map;
 import java.util.stream.Stream;
 
 import javax.json.JsonArray;
@@ -30,7 +28,6 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.ServiceStatus;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.health.HealthCheck;
-import org.apache.camel.health.HealthCheckConfiguration;
 import org.apache.camel.health.HealthCheckRegistry;
 import org.apache.camel.health.HealthCheckRepository;
 import org.eclipse.microprofile.health.HealthCheckResponse.Status;
@@ -120,21 +117,6 @@ public class CamelMicroProfileHealthCheckRepositoryTest 
extends CamelMicroProfil
             }
 
             @Override
-            public void setConfigurations(Map<String, 
HealthCheckConfiguration> configurations) {
-                // Noop
-            }
-
-            @Override
-            public Map<String, HealthCheckConfiguration> getConfigurations() {
-                return Collections.emptyMap();
-            }
-
-            @Override
-            public void addConfiguration(String id, HealthCheckConfiguration 
configuration) {
-                // Noop
-            }
-
-            @Override
             public Stream<HealthCheck> stream() {
                 return repositoryChecks.stream();
             }
diff --git 
a/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckTest.java
 
b/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckTest.java
index 298c842..6c8b5bf 100644
--- 
a/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckTest.java
+++ 
b/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckTest.java
@@ -178,7 +178,7 @@ public class CamelMicroProfileHealthCheckTest extends 
CamelMicroProfileHealthTes
 
         HealthCheck readinessCheck = createReadinessCheck("disabled-check", 
true, builder -> builder.up());
         healthCheckRegistry.register(readinessCheck);
-        readinessCheck.getConfiguration().setEnabled(false);
+        readinessCheck.setEnabled(false);
 
         SmallRyeHealth health = reporter.getHealth();
 
diff --git 
a/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthTestSupport.java
 
b/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthTestSupport.java
index be43695..4d472bc 100644
--- 
a/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthTestSupport.java
+++ 
b/components/camel-microprofile/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthTestSupport.java
@@ -104,7 +104,7 @@ public class CamelMicroProfileHealthTestSupport extends 
CamelTestSupport {
                 return false;
             }
         };
-        livenessCheck.getConfiguration().setEnabled(enabled);
+        livenessCheck.setEnabled(enabled);
         return livenessCheck;
     }
 
@@ -120,9 +120,8 @@ public class CamelMicroProfileHealthTestSupport extends 
CamelTestSupport {
                 return false;
             }
         };
-        readinessCheck.getConfiguration().setEnabled(enabled);
+        readinessCheck.setEnabled(enabled);
         return readinessCheck;
-
     }
 
     /**
diff --git 
a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckErrorDisabledConsumerTest.java
 
b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckErrorDisabledConsumerTest.java
index a9424bb..b0c222a 100644
--- 
a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckErrorDisabledConsumerTest.java
+++ 
b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckErrorDisabledConsumerTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.component.telegram.util.TelegramMockRoutes;
 import org.apache.camel.component.telegram.util.TelegramTestSupport;
 import org.apache.camel.health.HealthCheck;
-import org.apache.camel.health.HealthCheckConfiguration;
 import org.apache.camel.health.HealthCheckRegistry;
 import org.apache.camel.health.HealthCheckRepository;
 import org.awaitility.Awaitility;
@@ -50,7 +49,6 @@ public class 
TelegramConsumerHealthCheckErrorDisabledConsumerTest extends Telegr
         // enabling consumers health check is a bit cumbersome via low-level 
Java code
         repo = hcr.getRepository("consumers").orElse((HealthCheckRepository) 
hcr.resolveById("consumers"));
         // turn off all consumer health checks
-        repo.addConfiguration("consumer:*", 
HealthCheckConfiguration.builder().enabled(false).build());
         repo.setEnabled(true);
         hcr.register(repo);
 
diff --git 
a/core/camel-api/src/main/java/org/apache/camel/health/HealthCheck.java 
b/core/camel-api/src/main/java/org/apache/camel/health/HealthCheck.java
index 59ea3ae..0baa787 100644
--- a/core/camel-api/src/main/java/org/apache/camel/health/HealthCheck.java
+++ b/core/camel-api/src/main/java/org/apache/camel/health/HealthCheck.java
@@ -58,6 +58,16 @@ public interface HealthCheck extends HasGroup, HasId, 
Ordered {
     }
 
     /**
+     * Whether this health check is enabled
+     */
+    boolean isEnabled();
+
+    /**
+     * Used for enabling or disabling this health check
+     */
+    void setEnabled(boolean enabled);
+
+    /**
      * Return metadata associated with this {@link HealthCheck}.
      */
     default Map<String, Object> getMetaData() {
@@ -79,11 +89,6 @@ public interface HealthCheck extends HasGroup, HasId, 
Ordered {
     }
 
     /**
-     * Return the configuration associated with this {@link HealthCheck}.
-     */
-    HealthCheckConfiguration getConfiguration();
-
-    /**
      * Invoke the check.
      *
      * @see #call(Map)
diff --git 
a/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckConfiguration.java
 
b/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckConfiguration.java
deleted file mode 100644
index 9d7199e..0000000
--- 
a/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckConfiguration.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.health;
-
-import org.apache.camel.RuntimeCamelException;
-
-/**
- * Configuration for {@link HealthCheck}.
- */
-public class HealthCheckConfiguration implements Cloneable {
-
-    // TODO: Can we avoid this as there are no configuration: only enabled 
true|false
-
-    private String parent;
-    private boolean enabled = true;
-
-    // *************************************************
-    // Properties
-    // *************************************************
-
-    public String getParent() {
-        return parent;
-    }
-
-    /**
-     * The id of the health check such as routes or registry (can use * as 
wildcard)
-     */
-    public void setParent(String parent) {
-        this.parent = parent;
-    }
-
-    public boolean isEnabled() {
-        return enabled;
-    }
-
-    /**
-     * Set if the check associated to this configuration is enabled or not.
-     *
-     * Is default enabled.
-     */
-    public void setEnabled(boolean enabled) {
-        this.enabled = enabled;
-    }
-
-    public HealthCheckConfiguration copy() {
-        try {
-            return (HealthCheckConfiguration) super.clone();
-        } catch (CloneNotSupportedException e) {
-            throw new RuntimeCamelException(e);
-        }
-    }
-
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    // *************************************************
-    //
-    // *************************************************
-
-    public static final class Builder implements 
org.apache.camel.Builder<HealthCheckConfiguration> {
-        private String parent;
-        private Boolean enabled;
-
-        private Builder() {
-        }
-
-        public Builder complete(HealthCheckConfiguration template) {
-            if (template != null) {
-                if (this.parent == null) {
-                    this.parent = template.parent;
-                }
-                if (this.enabled == null) {
-                    this.enabled = template.enabled;
-                }
-            }
-
-            return this;
-        }
-
-        public Builder parent(String parent) {
-            this.parent = parent;
-            return this;
-        }
-
-        public Builder enabled(boolean enabled) {
-            this.enabled = enabled;
-            return this;
-        }
-
-        @Override
-        public HealthCheckConfiguration build() {
-            HealthCheckConfiguration conf = new HealthCheckConfiguration();
-            if (parent != null) {
-                conf.setParent(parent);
-            }
-            if (enabled != null) {
-                conf.setEnabled(enabled);
-            }
-            return conf;
-        }
-    }
-}
diff --git 
a/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckHelper.java 
b/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckHelper.java
index 336b7a2..1fe0d56 100644
--- 
a/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckHelper.java
+++ 
b/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckHelper.java
@@ -118,7 +118,7 @@ public final class HealthCheckHelper {
                     .entrySet().stream()
                     .map(Map.Entry::getValue)
                     .flatMap(Collection::stream)
-                    .filter(check -> !filter.test(check))
+                    .filter(check -> !registry.isExcluded(check) && 
!filter.test(check))
                     .sorted(Comparator.comparingInt(HealthCheck::getOrder))
                     .distinct()
                     .map(check -> check.call(optionsSupplier.apply(check)))
diff --git 
a/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckRegistry.java 
b/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckRegistry.java
index 9f28f33..8101c04 100644
--- 
a/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckRegistry.java
+++ 
b/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckRegistry.java
@@ -121,4 +121,21 @@ public interface HealthCheckRegistry extends 
CamelContextAware, StaticService, I
      */
     void loadHealthChecks();
 
+    /**
+     * Pattern to exclude health checks from being invoked by Camel when 
checking healths. Multiple patterns can be
+     * separated by comma.
+     */
+    String getExcludePattern();
+
+    /**
+     * Pattern to exclude health checks from being invoked by Camel when 
checking healths. Multiple patterns can be
+     * separated by comma.
+     */
+    void setExcludePattern(String excludePattern);
+
+    /**
+     * Whether the given health check has been excluded
+     */
+    boolean isExcluded(HealthCheck healthCheck);
+
 }
diff --git 
a/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckRepository.java
 
b/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckRepository.java
index 2041c00..9433e5e 100644
--- 
a/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckRepository.java
+++ 
b/core/camel-api/src/main/java/org/apache/camel/health/HealthCheckRepository.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.health;
 
-import java.util.Map;
 import java.util.Optional;
 import java.util.stream.Stream;
 
@@ -39,24 +38,6 @@ public interface HealthCheckRepository extends HasId {
     void setEnabled(boolean enabled);
 
     /**
-     * Configurations for health checks based on their ids
-     */
-    void setConfigurations(Map<String, HealthCheckConfiguration> 
configurations);
-
-    /**
-     * Configurations for health checks based on their ids
-     */
-    Map<String, HealthCheckConfiguration> getConfigurations();
-
-    /**
-     * Adds a health check configuration
-     *
-     * @param id            the health check id (can use patterns)
-     * @param configuration the configuration
-     */
-    void addConfiguration(String id, HealthCheckConfiguration configuration);
-
-    /**
      * Returns a sequential {@code Stream} with the known {@link HealthCheck} 
as its source.
      */
     Stream<HealthCheck> stream();
diff --git 
a/core/camel-core/src/test/java/org/apache/camel/impl/health/HealthCheckTest.java
 
b/core/camel-core/src/test/java/org/apache/camel/impl/health/HealthCheckTest.java
index 1af8fb9..4fbeb94 100644
--- 
a/core/camel-core/src/test/java/org/apache/camel/impl/health/HealthCheckTest.java
+++ 
b/core/camel-core/src/test/java/org/apache/camel/impl/health/HealthCheckTest.java
@@ -33,7 +33,7 @@ public class HealthCheckTest {
         MyHealthCheck check = new MyHealthCheck();
         check.setState(HealthCheck.State.UP);
         // disable
-        check.getConfiguration().setEnabled(false);
+        check.setEnabled(false);
 
         HealthCheck.Result result;
 
@@ -44,7 +44,7 @@ public class HealthCheckTest {
         assertEquals("Disabled", result.getMessage().get());
         assertEquals(false, 
result.getDetails().get(AbstractHealthCheck.CHECK_ENABLED));
 
-        check.getConfiguration().setEnabled(true);
+        check.setEnabled(true);
 
         result = check.call();
 
diff --git 
a/core/camel-health/src/main/java/org/apache/camel/impl/health/AbstractHealthCheck.java
 
b/core/camel-health/src/main/java/org/apache/camel/impl/health/AbstractHealthCheck.java
index acd9264..8b7839a 100644
--- 
a/core/camel-health/src/main/java/org/apache/camel/impl/health/AbstractHealthCheck.java
+++ 
b/core/camel-health/src/main/java/org/apache/camel/impl/health/AbstractHealthCheck.java
@@ -26,7 +26,6 @@ import java.util.concurrent.ConcurrentMap;
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
 import org.apache.camel.health.HealthCheck;
-import org.apache.camel.health.HealthCheckConfiguration;
 import org.apache.camel.health.HealthCheckResultBuilder;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -40,11 +39,11 @@ public abstract class AbstractHealthCheck implements 
HealthCheck, CamelContextAw
     private static final Logger LOGGER = 
LoggerFactory.getLogger(AbstractHealthCheck.class);
 
     private CamelContext camelContext;
+    private boolean enabled = true;
     private final Object lock;
     private final String group;
     private final String id;
     private final ConcurrentMap<String, Object> meta;
-    private HealthCheckConfiguration configuration;
 
     protected AbstractHealthCheck(String id) {
         this(null, id, null);
@@ -58,7 +57,6 @@ public abstract class AbstractHealthCheck implements 
HealthCheck, CamelContextAw
         this.lock = new Object();
         this.group = group;
         this.id = ObjectHelper.notNull(id, "HealthCheck ID");
-        this.configuration = new HealthCheckConfiguration();
         this.meta = new ConcurrentHashMap<>();
 
         if (meta != null) {
@@ -92,17 +90,18 @@ public abstract class AbstractHealthCheck implements 
HealthCheck, CamelContextAw
     }
 
     @Override
-    public Map<String, Object> getMetaData() {
-        return Collections.unmodifiableMap(this.meta);
+    public boolean isEnabled() {
+        return enabled;
     }
 
     @Override
-    public HealthCheckConfiguration getConfiguration() {
-        return this.configuration;
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
     }
 
-    public void setConfiguration(HealthCheckConfiguration configuration) {
-        this.configuration = configuration;
+    @Override
+    public Map<String, Object> getMetaData() {
+        return Collections.unmodifiableMap(this.meta);
     }
 
     @Override
@@ -113,9 +112,7 @@ public abstract class AbstractHealthCheck implements 
HealthCheck, CamelContextAw
     @Override
     public Result call(Map<String, Object> options) {
         synchronized (lock) {
-            final HealthCheckConfiguration conf = getConfiguration();
             final HealthCheckResultBuilder builder = 
HealthCheckResultBuilder.on(this);
-            final boolean enabled = conf.isEnabled();
 
             // Extract relevant information from meta data.
             int invocationCount = (Integer) 
meta.getOrDefault(INVOCATION_COUNT, 0);
@@ -127,8 +124,8 @@ public abstract class AbstractHealthCheck implements 
HealthCheck, CamelContextAw
             // Set common meta-data
             meta.put(INVOCATION_ATTEMPT_TIME, invocationTime);
 
-            if (!enabled) {
-                LOGGER.debug("health-check {}/{} won't be invoked as not 
enabled", getGroup(), getId());
+            if (!isEnabled()) {
+                LOGGER.debug("health-check {}/{} disabled", getGroup(), 
getId());
 
                 builder.message("Disabled");
                 builder.detail(CHECK_ENABLED, false);
diff --git 
a/core/camel-health/src/main/java/org/apache/camel/impl/health/ConsumersHealthCheckRepository.java
 
b/core/camel-health/src/main/java/org/apache/camel/impl/health/ConsumersHealthCheckRepository.java
index 79ce263..b4244d2 100644
--- 
a/core/camel-health/src/main/java/org/apache/camel/impl/health/ConsumersHealthCheckRepository.java
+++ 
b/core/camel-health/src/main/java/org/apache/camel/impl/health/ConsumersHealthCheckRepository.java
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.impl.health;
 
-import java.util.LinkedHashMap;
-import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.stream.Stream;
@@ -26,23 +24,23 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
 import org.apache.camel.Consumer;
 import org.apache.camel.DeferredContextBinding;
+import org.apache.camel.NonManagedService;
 import org.apache.camel.Route;
+import org.apache.camel.StaticService;
 import org.apache.camel.health.HealthCheck;
-import org.apache.camel.health.HealthCheckConfiguration;
 import org.apache.camel.health.HealthCheckRepository;
-import org.apache.camel.support.PatternHelper;
+import org.apache.camel.support.service.ServiceSupport;
 
 /**
  * Repository for consumers {@link HealthCheck}s.
  */
 @org.apache.camel.spi.annotations.HealthCheck("consumers-repository")
 @DeferredContextBinding
-public class ConsumersHealthCheckRepository implements CamelContextAware, 
HealthCheckRepository {
+public class ConsumersHealthCheckRepository extends ServiceSupport
+        implements CamelContextAware, HealthCheckRepository, StaticService, 
NonManagedService {
 
     private final ConcurrentMap<Consumer, HealthCheck> checks;
     private volatile CamelContext context;
-    private Map<String, HealthCheckConfiguration> configurations;
-    private HealthCheckConfiguration fallbackConfiguration;
     private boolean enabled = true;
 
     public ConsumersHealthCheckRepository() {
@@ -65,28 +63,6 @@ public class ConsumersHealthCheckRepository implements 
CamelContextAware, Health
     }
 
     @Override
-    public Map<String, HealthCheckConfiguration> getConfigurations() {
-        return configurations;
-    }
-
-    @Override
-    public void setConfigurations(Map<String, HealthCheckConfiguration> 
configurations) {
-        this.configurations = configurations;
-    }
-
-    @Override
-    public void addConfiguration(String id, HealthCheckConfiguration 
configuration) {
-        if ("*".equals(id)) {
-            fallbackConfiguration = configuration;
-        } else {
-            if (configurations == null) {
-                configurations = new LinkedHashMap<>();
-            }
-            configurations.put(id, configuration);
-        }
-    }
-
-    @Override
     public boolean isEnabled() {
         return enabled;
     }
@@ -127,23 +103,8 @@ public class ConsumersHealthCheckRepository implements 
CamelContextAware, Health
             String id = "consumer:" + route.getRouteId();
             ConsumerHealthCheck chc = new ConsumerHealthCheck(route, id);
             CamelContextAware.trySetCamelContext(chc, route.getCamelContext());
-            HealthCheckConfiguration hcc = matchConfiguration(id);
-            if (hcc != null) {
-                chc.setConfiguration(hcc);
-            }
             return chc;
         });
     }
 
-    private HealthCheckConfiguration matchConfiguration(String id) {
-        if (configurations != null) {
-            for (Map.Entry<String, HealthCheckConfiguration> 
configurationEntry : configurations.entrySet()) {
-                if (PatternHelper.matchPattern(id, 
configurationEntry.getKey())) {
-                    return configurationEntry.getValue();
-                }
-            }
-        }
-        return fallbackConfiguration;
-    }
-
 }
diff --git 
a/core/camel-health/src/main/java/org/apache/camel/impl/health/DefaultHealthCheckRegistry.java
 
b/core/camel-health/src/main/java/org/apache/camel/impl/health/DefaultHealthCheckRegistry.java
index 7ef3c37..59cb0f4 100644
--- 
a/core/camel-health/src/main/java/org/apache/camel/impl/health/DefaultHealthCheckRegistry.java
+++ 
b/core/camel-health/src/main/java/org/apache/camel/impl/health/DefaultHealthCheckRegistry.java
@@ -30,6 +30,8 @@ import org.apache.camel.health.HealthCheck;
 import org.apache.camel.health.HealthCheckRegistry;
 import org.apache.camel.health.HealthCheckRepository;
 import org.apache.camel.health.HealthCheckResolver;
+import org.apache.camel.support.PatternHelper;
+import org.apache.camel.support.service.ServiceHelper;
 import org.apache.camel.support.service.ServiceSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.StopWatch;
@@ -50,6 +52,7 @@ public class DefaultHealthCheckRegistry extends 
ServiceSupport implements Health
     private final Set<HealthCheckRepository> repositories;
     private CamelContext camelContext;
     private boolean enabled = true;
+    private String excludePattern;
     private volatile boolean loadHealthChecksDone;
 
     public DefaultHealthCheckRegistry() {
@@ -84,6 +87,16 @@ public class DefaultHealthCheckRegistry extends 
ServiceSupport implements Health
     }
 
     @Override
+    public String getExcludePattern() {
+        return excludePattern;
+    }
+
+    @Override
+    public void setExcludePattern(String excludePattern) {
+        this.excludePattern = excludePattern;
+    }
+
+    @Override
     protected void doInit() throws Exception {
         super.doInit();
 
@@ -102,6 +115,18 @@ public class DefaultHealthCheckRegistry extends 
ServiceSupport implements Health
         for (HealthCheckRepository repository : repositories) {
             CamelContextAware.trySetCamelContext(repository, camelContext);
         }
+
+        ServiceHelper.initService(repositories, checks);
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        ServiceHelper.startService(repositories, checks);
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        ServiceHelper.stopService(repositories, checks);
     }
 
     // ************************************
@@ -251,6 +276,23 @@ public class DefaultHealthCheckRegistry extends 
ServiceSupport implements Health
         }
     }
 
+    @Override
+    public boolean isExcluded(HealthCheck healthCheck) {
+        if (excludePattern != null) {
+            String[] s = excludePattern.split(",");
+            String id = healthCheck.getId();
+            String id2 = null;
+            // special for route and consumer health checks
+            if (id.startsWith("route:")) {
+                id2 = id.substring(6);
+            } else if (id.startsWith("consumer:")) {
+                id2 = id.substring(9);
+            }
+            return PatternHelper.matchPatterns(id, s) || (id2 != null && 
PatternHelper.matchPatterns(id2, s));
+        }
+        return false;
+    }
+
     private void checkIfAccepted(Object obj) {
         boolean accept = obj instanceof HealthCheck || obj instanceof 
HealthCheckRepository;
         if (!accept) {
diff --git 
a/core/camel-health/src/main/java/org/apache/camel/impl/health/HealthCheckRegistryRepository.java
 
b/core/camel-health/src/main/java/org/apache/camel/impl/health/HealthCheckRegistryRepository.java
index 6db6238..54210e6 100644
--- 
a/core/camel-health/src/main/java/org/apache/camel/impl/health/HealthCheckRegistryRepository.java
+++ 
b/core/camel-health/src/main/java/org/apache/camel/impl/health/HealthCheckRegistryRepository.java
@@ -16,27 +16,25 @@
  */
 package org.apache.camel.impl.health;
 
-import java.util.LinkedHashMap;
-import java.util.Map;
 import java.util.Set;
 import java.util.stream.Stream;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
+import org.apache.camel.NonManagedService;
+import org.apache.camel.StaticService;
 import org.apache.camel.health.HealthCheck;
-import org.apache.camel.health.HealthCheckConfiguration;
 import org.apache.camel.health.HealthCheckRepository;
-import org.apache.camel.support.PatternHelper;
+import org.apache.camel.support.service.ServiceSupport;
 
 /**
  * {@link HealthCheckRepository} that uses the Camel {@link 
org.apache.camel.spi.Registry}.
  *
  * Camel will use this by default, so there is no need to register this 
manually.
  */
-public class HealthCheckRegistryRepository implements CamelContextAware, 
HealthCheckRepository {
+public class HealthCheckRegistryRepository extends ServiceSupport
+        implements CamelContextAware, HealthCheckRepository, StaticService, 
NonManagedService {
     private CamelContext context;
-    private Map<String, HealthCheckConfiguration> configurations;
-    private HealthCheckConfiguration fallbackConfiguration;
     private boolean enabled = true;
 
     @Override
@@ -55,28 +53,6 @@ public class HealthCheckRegistryRepository implements 
CamelContextAware, HealthC
     }
 
     @Override
-    public Map<String, HealthCheckConfiguration> getConfigurations() {
-        return configurations;
-    }
-
-    @Override
-    public void setConfigurations(Map<String, HealthCheckConfiguration> 
configurations) {
-        this.configurations = configurations;
-    }
-
-    @Override
-    public void addConfiguration(String id, HealthCheckConfiguration 
configuration) {
-        if ("*".equals(id)) {
-            fallbackConfiguration = configuration;
-        } else {
-            if (configurations == null) {
-                configurations = new LinkedHashMap<>();
-            }
-            configurations.put(id, configuration);
-        }
-    }
-
-    @Override
     public boolean isEnabled() {
         return enabled;
     }
@@ -97,21 +73,7 @@ public class HealthCheckRegistryRepository implements 
CamelContextAware, HealthC
     }
 
     private HealthCheck toHealthCheck(HealthCheck hc) {
-        if (configurations != null) {
-            HealthCheckConfiguration hcc = matchConfiguration(hc.getId());
-            if (hcc != null) {
-                hc.getConfiguration().setEnabled(hcc.isEnabled());
-            }
-        }
         return hc;
     }
 
-    private HealthCheckConfiguration matchConfiguration(String id) {
-        for (Map.Entry<String, HealthCheckConfiguration> entry : 
configurations.entrySet()) {
-            if (PatternHelper.matchPattern(id, entry.getKey())) {
-                return entry.getValue();
-            }
-        }
-        return fallbackConfiguration;
-    }
 }
diff --git 
a/core/camel-health/src/main/java/org/apache/camel/impl/health/RoutesHealthCheckRepository.java
 
b/core/camel-health/src/main/java/org/apache/camel/impl/health/RoutesHealthCheckRepository.java
index 01c91e3..f7cd2fb 100644
--- 
a/core/camel-health/src/main/java/org/apache/camel/impl/health/RoutesHealthCheckRepository.java
+++ 
b/core/camel-health/src/main/java/org/apache/camel/impl/health/RoutesHealthCheckRepository.java
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.impl.health;
 
-import java.util.LinkedHashMap;
-import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.stream.Stream;
@@ -25,23 +23,23 @@ import java.util.stream.Stream;
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
 import org.apache.camel.DeferredContextBinding;
+import org.apache.camel.NonManagedService;
 import org.apache.camel.Route;
+import org.apache.camel.StaticService;
 import org.apache.camel.health.HealthCheck;
-import org.apache.camel.health.HealthCheckConfiguration;
 import org.apache.camel.health.HealthCheckRepository;
-import org.apache.camel.support.PatternHelper;
+import org.apache.camel.support.service.ServiceSupport;
 
 /**
  * Repository for routes {@link HealthCheck}s.
  */
 @org.apache.camel.spi.annotations.HealthCheck("routes-repository")
 @DeferredContextBinding
-public class RoutesHealthCheckRepository implements CamelContextAware, 
HealthCheckRepository {
+public class RoutesHealthCheckRepository extends ServiceSupport
+        implements CamelContextAware, HealthCheckRepository, StaticService, 
NonManagedService {
 
     private final ConcurrentMap<Route, HealthCheck> checks;
     private volatile CamelContext context;
-    private Map<String, HealthCheckConfiguration> configurations;
-    private HealthCheckConfiguration fallbackConfiguration;
     private boolean enabled = true;
 
     public RoutesHealthCheckRepository() {
@@ -64,28 +62,6 @@ public class RoutesHealthCheckRepository implements 
CamelContextAware, HealthChe
     }
 
     @Override
-    public Map<String, HealthCheckConfiguration> getConfigurations() {
-        return configurations;
-    }
-
-    @Override
-    public void setConfigurations(Map<String, HealthCheckConfiguration> 
configurations) {
-        this.configurations = configurations;
-    }
-
-    @Override
-    public void addConfiguration(String id, HealthCheckConfiguration 
configuration) {
-        if ("*".equals(id)) {
-            fallbackConfiguration = configuration;
-        } else {
-            if (configurations == null) {
-                configurations = new LinkedHashMap<>();
-            }
-            configurations.put(id, configuration);
-        }
-    }
-
-    @Override
     public boolean isEnabled() {
         return enabled;
     }
@@ -124,23 +100,8 @@ public class RoutesHealthCheckRepository implements 
CamelContextAware, HealthChe
         return checks.computeIfAbsent(route, r -> {
             RouteHealthCheck rhc = new RouteHealthCheck(route);
             CamelContextAware.trySetCamelContext(rhc, route.getCamelContext());
-            HealthCheckConfiguration hcc = 
matchConfiguration(route.getRouteId());
-            if (hcc != null) {
-                rhc.setConfiguration(hcc);
-            }
             return rhc;
         });
     }
 
-    private HealthCheckConfiguration matchConfiguration(String id) {
-        if (configurations != null) {
-            for (Map.Entry<String, HealthCheckConfiguration> 
configurationEntry : configurations.entrySet()) {
-                if (PatternHelper.matchPattern(id, 
configurationEntry.getKey())) {
-                    return configurationEntry.getValue();
-                }
-            }
-        }
-        return fallbackConfiguration;
-    }
-
 }
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/HealthCheckConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/HealthCheckConfigurationPropertiesConfigurer.java
deleted file mode 100644
index 3ac7b62..0000000
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/HealthCheckConfigurationPropertiesConfigurer.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.main;
-
-import java.util.Map;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
-import org.apache.camel.spi.PropertyConfigurerGetter;
-import org.apache.camel.spi.ConfigurerStrategy;
-import org.apache.camel.spi.GeneratedPropertyConfigurer;
-import org.apache.camel.util.CaseInsensitiveMap;
-import org.apache.camel.main.HealthCheckConfigurationProperties;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-@SuppressWarnings("unchecked")
-public class HealthCheckConfigurationPropertiesConfigurer extends 
org.apache.camel.support.component.PropertyConfigurerSupport implements 
GeneratedPropertyConfigurer, PropertyConfigurerGetter {
-
-    @Override
-    public boolean configure(CamelContext camelContext, Object obj, String 
name, Object value, boolean ignoreCase) {
-        org.apache.camel.main.HealthCheckConfigurationProperties target = 
(org.apache.camel.main.HealthCheckConfigurationProperties) obj;
-        switch (ignoreCase ? name.toLowerCase() : name) {
-        case "enabled":
-        case "Enabled": target.setEnabled(property(camelContext, 
boolean.class, value)); return true;
-        case "parent":
-        case "Parent": target.setParent(property(camelContext, 
java.lang.String.class, value)); return true;
-        default: return false;
-        }
-    }
-
-    @Override
-    public Class<?> getOptionType(String name, boolean ignoreCase) {
-        switch (ignoreCase ? name.toLowerCase() : name) {
-        case "enabled":
-        case "Enabled": return boolean.class;
-        case "parent":
-        case "Parent": return java.lang.String.class;
-        default: return null;
-        }
-    }
-
-    @Override
-    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
-        org.apache.camel.main.HealthCheckConfigurationProperties target = 
(org.apache.camel.main.HealthCheckConfigurationProperties) obj;
-        switch (ignoreCase ? name.toLowerCase() : name) {
-        case "enabled":
-        case "Enabled": return target.isEnabled();
-        case "parent":
-        case "Parent": return target.getParent();
-        default: return null;
-        }
-    }
-}
-
diff --git 
a/core/camel-main/src/generated/java/org/apache/camel/main/HealthConfigurationPropertiesConfigurer.java
 
b/core/camel-main/src/generated/java/org/apache/camel/main/HealthConfigurationPropertiesConfigurer.java
index e44bf31..897ffc2 100644
--- 
a/core/camel-main/src/generated/java/org/apache/camel/main/HealthConfigurationPropertiesConfigurer.java
+++ 
b/core/camel-main/src/generated/java/org/apache/camel/main/HealthConfigurationPropertiesConfigurer.java
@@ -21,14 +21,14 @@ public class HealthConfigurationPropertiesConfigurer 
extends org.apache.camel.su
     public boolean configure(CamelContext camelContext, Object obj, String 
name, Object value, boolean ignoreCase) {
         org.apache.camel.main.HealthConfigurationProperties target = 
(org.apache.camel.main.HealthConfigurationProperties) obj;
         switch (ignoreCase ? name.toLowerCase() : name) {
-        case "config":
-        case "Config": target.setConfig(property(camelContext, 
java.util.Map.class, value)); return true;
         case "consumersenabled":
         case "ConsumersEnabled": 
target.setConsumersEnabled(property(camelContext, java.lang.Boolean.class, 
value)); return true;
         case "contextenabled":
         case "ContextEnabled": target.setContextEnabled(property(camelContext, 
java.lang.Boolean.class, value)); return true;
         case "enabled":
         case "Enabled": target.setEnabled(property(camelContext, 
java.lang.Boolean.class, value)); return true;
+        case "excludepattern":
+        case "ExcludePattern": target.setExcludePattern(property(camelContext, 
java.lang.String.class, value)); return true;
         case "registryenabled":
         case "RegistryEnabled": 
target.setRegistryEnabled(property(camelContext, java.lang.Boolean.class, 
value)); return true;
         case "routesenabled":
@@ -40,14 +40,14 @@ public class HealthConfigurationPropertiesConfigurer 
extends org.apache.camel.su
     @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
-        case "config":
-        case "Config": return java.util.Map.class;
         case "consumersenabled":
         case "ConsumersEnabled": return java.lang.Boolean.class;
         case "contextenabled":
         case "ContextEnabled": return java.lang.Boolean.class;
         case "enabled":
         case "Enabled": return java.lang.Boolean.class;
+        case "excludepattern":
+        case "ExcludePattern": return java.lang.String.class;
         case "registryenabled":
         case "RegistryEnabled": return java.lang.Boolean.class;
         case "routesenabled":
@@ -60,14 +60,14 @@ public class HealthConfigurationPropertiesConfigurer 
extends org.apache.camel.su
     public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
         org.apache.camel.main.HealthConfigurationProperties target = 
(org.apache.camel.main.HealthConfigurationProperties) obj;
         switch (ignoreCase ? name.toLowerCase() : name) {
-        case "config":
-        case "Config": return target.getConfig();
         case "consumersenabled":
         case "ConsumersEnabled": return target.getConsumersEnabled();
         case "contextenabled":
         case "ContextEnabled": return target.getContextEnabled();
         case "enabled":
         case "Enabled": return target.getEnabled();
+        case "excludepattern":
+        case "ExcludePattern": return target.getExcludePattern();
         case "registryenabled":
         case "RegistryEnabled": return target.getRegistryEnabled();
         case "routesenabled":
@@ -75,14 +75,5 @@ public class HealthConfigurationPropertiesConfigurer extends 
org.apache.camel.su
         default: return null;
         }
     }
-
-    @Override
-    public Object getCollectionValueType(Object target, String name, boolean 
ignoreCase) {
-        switch (ignoreCase ? name.toLowerCase() : name) {
-        case "config":
-        case "Config": return 
org.apache.camel.main.HealthCheckConfigurationProperties.class;
-        default: return null;
-        }
-    }
 }
 
diff --git 
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
 
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index 0eaab4a..1d8e638 100644
--- 
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++ 
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -131,10 +131,10 @@
     { "name": "camel.faulttolerance.timeoutEnabled", "description": "Whether 
timeout is enabled or not on the circuit breaker. Default is false.", 
"sourceType": "org.apache.camel.main.FaultToleranceConfigurationProperties", 
"type": "boolean", "javaType": "java.lang.Boolean", "defaultValue": false },
     { "name": "camel.faulttolerance.timeoutPoolSize", "description": 
"Configures the pool size of the thread pool when timeout is enabled. Default 
value is 10.", "sourceType": 
"org.apache.camel.main.FaultToleranceConfigurationProperties", "type": 
"integer", "javaType": "java.lang.Integer", "defaultValue": 10 },
     { "name": "camel.faulttolerance.timeoutScheduledExecutorServiceRef", 
"description": "References to a custom thread pool to use when timeout is 
enabled", "sourceType": 
"org.apache.camel.main.FaultToleranceConfigurationProperties", "type": 
"string", "javaType": "java.lang.String" },
-    { "name": "camel.health.config", "description": "Set additional 
HealthConfigurationProperties for fine grained configuration of health 
checks.", "sourceType": "org.apache.camel.main.HealthConfigurationProperties", 
"type": "object", "javaType": "java.util.Map" },
     { "name": "camel.health.consumersEnabled", "description": "Whether 
consumers health check is enabled", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties", "type": "boolean", 
"javaType": "java.lang.Boolean", "defaultValue": true },
     { "name": "camel.health.contextEnabled", "description": "Whether context 
health check is enabled", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties", "type": "boolean", 
"javaType": "java.lang.Boolean", "defaultValue": true },
     { "name": "camel.health.enabled", "description": "Whether health check is 
enabled globally", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties", "type": "boolean", 
"javaType": "java.lang.Boolean", "defaultValue": true },
+    { "name": "camel.health.excludePattern", "description": "Pattern to 
exclude health checks from being invoked by Camel when checking healths. 
Multiple patterns can be separated by comma.", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties", "type": "string", 
"javaType": "java.lang.String" },
     { "name": "camel.health.registryEnabled", "description": "Whether registry 
health check is enabled", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties", "type": "boolean", 
"javaType": "java.lang.Boolean", "defaultValue": true },
     { "name": "camel.health.routesEnabled", "description": "Whether routes 
health check is enabled", "sourceType": 
"org.apache.camel.main.HealthConfigurationProperties", "type": "boolean", 
"javaType": "java.lang.Boolean", "defaultValue": true },
     { "name": "camel.hystrix.allowMaximumSizeToDivergeFromCoreSize", 
"description": "Allows the configuration for maximumSize to take effect. That 
value can then be equal to, or higher, than coreSize", "sourceType": 
"org.apache.camel.main.HystrixConfigurationProperties", "type": "boolean", 
"javaType": "java.lang.Boolean", "defaultValue": "false", "deprecated": true },
diff --git 
a/core/camel-main/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.main.HealthCheckConfigurationProperties
 
b/core/camel-main/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.main.HealthCheckConfigurationProperties
deleted file mode 100644
index 5a563d7..0000000
--- 
a/core/camel-main/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.main.HealthCheckConfigurationProperties
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.main.HealthCheckConfigurationPropertiesConfigurer
diff --git a/core/camel-main/src/main/docs/main.adoc 
b/core/camel-main/src/main/docs/main.adoc
index 7d726e7..286680c 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -155,10 +155,10 @@ The camel.health supports 6 options, which are listed 
below.
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *camel.health.config* | Set additional HealthConfigurationProperties for 
fine grained configuration of health checks. |  | Map
 | *camel.health.consumersEnabled* | Whether consumers health check is enabled 
| true | Boolean
 | *camel.health.contextEnabled* | Whether context health check is enabled | 
true | Boolean
 | *camel.health.enabled* | Whether health check is enabled globally | true | 
Boolean
+| *camel.health.excludePattern* | Pattern to exclude health checks from being 
invoked by Camel when checking healths. Multiple patterns can be separated by 
comma. |  | String
 | *camel.health.registryEnabled* | Whether registry health check is enabled | 
true | Boolean
 | *camel.health.routesEnabled* | Whether routes health check is enabled | true 
| Boolean
 |===
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java 
b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
index 92f3d8c..50158f6 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
@@ -21,7 +21,6 @@ import java.io.FileInputStream;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
@@ -45,7 +44,6 @@ import org.apache.camel.StartupStep;
 import org.apache.camel.console.DevConsole;
 import org.apache.camel.console.DevConsoleRegistry;
 import org.apache.camel.health.HealthCheck;
-import org.apache.camel.health.HealthCheckConfiguration;
 import org.apache.camel.health.HealthCheckRegistry;
 import org.apache.camel.health.HealthCheckRepository;
 import org.apache.camel.saga.CamelSagaService;
@@ -994,44 +992,28 @@ public abstract class BaseMainSupport extends BaseService 
{
 
         HealthConfigurationProperties health = 
mainConfigurationProperties.health();
 
-        // extract all config to know their parent ids so we can set the 
values afterwards
-        Map<String, Object> hcConfig = 
PropertiesHelper.extractProperties(healthCheckProperties, "config", false);
-        Map<String, HealthCheckConfigurationProperties> hcConfigs = new 
HashMap<>();
-        // build set of configuration objects
-        for (Map.Entry<String, Object> entry : hcConfig.entrySet()) {
-            String parent = StringHelper.between(entry.getKey(), "[", "]");
-            if (parent != null) {
-                HealthCheckConfigurationProperties hcp = hcConfigs.get(parent);
-                if (hcp == null) {
-                    hcp = new HealthCheckConfigurationProperties();
-                    hcConfigs.put(parent, hcp);
-                }
-            }
-        }
-        if (health.getConfig() != null) {
-            health.getConfig().putAll(hcConfigs);
-        } else {
-            health.setConfig(hcConfigs);
-        }
-
         setPropertiesOnTarget(camelContext, health, healthCheckProperties, 
"camel.health.",
                 mainConfigurationProperties.isAutoConfigurationFailFast(), 
true, autoConfiguredProperties);
 
         if (health.getEnabled() != null) {
             hcr.setEnabled(health.getEnabled());
         }
+        if (health.getExcludePattern() != null) {
+            hcr.setExcludePattern(health.getExcludePattern());
+        }
+
         // context is enabled by default
-        if (hcr.isEnabled() && (!health.getConfig().containsKey("context") || 
health.getContextEnabled() != null)) {
+        if (hcr.isEnabled()) {
             HealthCheck hc = (HealthCheck) hcr.resolveById("context");
             if (hc != null) {
                 if (health.getContextEnabled() != null) {
-                    
hc.getConfiguration().setEnabled(health.getContextEnabled());
+                    hc.setEnabled(health.getContextEnabled());
                 }
                 hcr.register(hc);
             }
         }
         // routes are enabled by default
-        if (hcr.isEnabled() && (!health.getConfig().containsKey("routes") || 
health.getRoutesEnabled() != null)) {
+        if (hcr.isEnabled()) {
             HealthCheckRepository hc = 
hcr.getRepository("routes").orElse((HealthCheckRepository) 
hcr.resolveById("routes"));
             if (hc != null) {
                 if (health.getRoutesEnabled() != null) {
@@ -1041,7 +1023,7 @@ public abstract class BaseMainSupport extends BaseService 
{
             }
         }
         // consumers are enabled by default
-        if (hcr.isEnabled() && (!health.getConfig().containsKey("consumers") 
|| health.getRegistryEnabled() != null)) {
+        if (hcr.isEnabled()) {
             HealthCheckRepository hc
                     = 
hcr.getRepository("consumers").orElse((HealthCheckRepository) 
hcr.resolveById("consumers"));
             if (hc != null) {
@@ -1052,7 +1034,7 @@ public abstract class BaseMainSupport extends BaseService 
{
             }
         }
         // registry are enabled by default
-        if (hcr.isEnabled() && (!health.getConfig().containsKey("registry") || 
health.getRegistryEnabled() != null)) {
+        if (hcr.isEnabled()) {
             HealthCheckRepository hc
                     = 
hcr.getRepository("registry").orElse((HealthCheckRepository) 
hcr.resolveById("registry"));
             if (hc != null) {
@@ -1062,31 +1044,6 @@ public abstract class BaseMainSupport extends 
BaseService {
                 hcr.register(hc);
             }
         }
-
-        // configure health checks configurations
-        for (String id : health.getConfig().keySet()) {
-            HealthCheckConfiguration hcc = health.getConfig().get(id);
-            String parent = hcc.getParent();
-            if (parent == null) {
-                throw new IllegalArgumentException("HealthCheck with id: " + 
id + " must have parent configured");
-            }
-            // lookup health check by id
-            Object hc = hcr.getCheck(parent).orElse(null);
-            if (hc == null) {
-                hc = hcr.resolveById(parent);
-                if (hc == null) {
-                    LOG.warn("Cannot resolve HealthCheck with id: {} from 
classpath.", parent);
-                    continue;
-                }
-                hcr.register(hc);
-                if (hc instanceof HealthCheck) {
-                    ((HealthCheck) 
hc).getConfiguration().setParent(hcc.getParent());
-                    ((HealthCheck) 
hc).getConfiguration().setEnabled(hcc.isEnabled());
-                } else if (hc instanceof HealthCheckRepository) {
-                    ((HealthCheckRepository) hc).addConfiguration(id, hcc);
-                }
-            }
-        }
     }
 
     private void setLraCheckProperties(
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/HealthCheckConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/HealthCheckConfigurationProperties.java
deleted file mode 100644
index 90aca19..0000000
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/HealthCheckConfigurationProperties.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.main;
-
-import org.apache.camel.health.HealthCheckConfiguration;
-import org.apache.camel.spi.Configurer;
-
-@Configurer(bootstrap = true)
-public class HealthCheckConfigurationProperties extends 
HealthCheckConfiguration {
-
-}
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/HealthConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/HealthConfigurationProperties.java
index 6c403fa..69dc26c 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/HealthConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/HealthConfigurationProperties.java
@@ -16,9 +16,6 @@
  */
 package org.apache.camel.main;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import org.apache.camel.spi.BootstrapCloseable;
 import org.apache.camel.spi.Configurer;
 import org.apache.camel.spi.Metadata;
@@ -41,7 +38,8 @@ public class HealthConfigurationProperties implements 
BootstrapCloseable {
     private Boolean consumersEnabled;
     @Metadata(defaultValue = "true")
     private Boolean registryEnabled;
-    private Map<String, HealthCheckConfigurationProperties> config = new 
HashMap<>();
+    @Metadata
+    private String excludePattern;
 
     public HealthConfigurationProperties(MainConfigurationProperties parent) {
         this.parent = parent;
@@ -53,8 +51,6 @@ public class HealthConfigurationProperties implements 
BootstrapCloseable {
 
     @Override
     public void close() {
-        config.clear();
-        config = null;
         parent = null;
     }
 
@@ -113,15 +109,16 @@ public class HealthConfigurationProperties implements 
BootstrapCloseable {
         this.registryEnabled = registryEnabled;
     }
 
-    public Map<String, HealthCheckConfigurationProperties> getConfig() {
-        return config;
+    public String getExcludePattern() {
+        return excludePattern;
     }
 
     /**
-     * Set additional {@link HealthConfigurationProperties} for fine grained 
configuration of health checks.
+     * Pattern to exclude health checks from being invoked by Camel when 
checking healths. Multiple patterns can be
+     * separated by comma.
      */
-    public void setConfig(Map<String, HealthCheckConfigurationProperties> 
config) {
-        this.config = config;
+    public void setExcludePattern(String excludePattern) {
+        this.excludePattern = excludePattern;
     }
 
     /**
@@ -157,10 +154,11 @@ public class HealthConfigurationProperties implements 
BootstrapCloseable {
     }
 
     /**
-     * Additional {@link HealthConfigurationProperties} for fine grained 
configuration of health checks.
+     * Pattern to exclude health checks from being invoked by Camel when 
checking healths. Multiple patterns can be
+     * separated by comma.
      */
-    public HealthConfigurationProperties addConfig(String id, 
HealthCheckConfigurationProperties config) {
-        this.config.put(id, config);
+    public HealthConfigurationProperties withExcludePattern(String 
excludePattern) {
+        this.excludePattern = excludePattern;
         return this;
     }
 
diff --git 
a/core/camel-main/src/test/java/org/apache/camel/main/MainHealthCheckConfigTest.java
 
b/core/camel-main/src/test/java/org/apache/camel/main/MainHealthCheckExcludedPatternTest.java
similarity index 57%
rename from 
core/camel-main/src/test/java/org/apache/camel/main/MainHealthCheckConfigTest.java
rename to 
core/camel-main/src/test/java/org/apache/camel/main/MainHealthCheckExcludedPatternTest.java
index 4342e11..a541871 100644
--- 
a/core/camel-main/src/test/java/org/apache/camel/main/MainHealthCheckConfigTest.java
+++ 
b/core/camel-main/src/test/java/org/apache/camel/main/MainHealthCheckExcludedPatternTest.java
@@ -19,12 +19,13 @@ package org.apache.camel.main;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.stream.Collectors;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.health.HealthCheck;
-import org.apache.camel.health.HealthCheckConfiguration;
+import org.apache.camel.health.HealthCheckHelper;
 import org.apache.camel.health.HealthCheckRegistry;
 import org.apache.camel.health.HealthCheckRepository;
 import org.apache.camel.health.HealthCheckResultBuilder;
@@ -38,17 +39,14 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class MainHealthCheckConfigTest {
+public class MainHealthCheckExcludedPatternTest {
 
     @Test
-    public void testMainRoutesHealthCheckConfiguration() {
+    public void testMainRoutesHealthCheckExcluded() {
         Main main = new Main();
         main.configure().addRoutesBuilder(new Routes());
-        main.addInitialProperty("camel.health.config[direct].parent", 
"routes");
-        main.addInitialProperty("camel.health.config[direct].enabled", "true");
-        main.addInitialProperty("camel.health.config[seda].parent", "routes");
-        main.addInitialProperty("camel.health.config[seda].enabled", "false");
         main.addInitialProperty("camel.health.routes-enabled", "true");
+        main.addInitialProperty("camel.health.exclude-pattern", "myseda");
 
         main.start();
         try {
@@ -64,43 +62,38 @@ public class MainHealthCheckConfigTest {
             RoutesHealthCheckRepository routesRepository = 
(RoutesHealthCheckRepository) routes.get();
             assertTrue(routesRepository.isEnabled());
 
-            Map<String, HealthCheckConfiguration> configurations = 
routesRepository.getConfigurations();
-            assertNotNull(configurations);
-            assertEquals(2, configurations.size());
+            HealthCheck hc = healthCheckRegistry.getCheck("mydirect").get();
+            assertTrue(hc.isEnabled());
+            assertFalse(healthCheckRegistry.isExcluded(hc));
 
-            HealthCheckConfiguration direct = configurations.get("direct");
-            assertNotNull(direct);
-            assertTrue(direct.isEnabled());
-
-            HealthCheckConfiguration seda = configurations.get("seda");
-            assertNotNull(seda);
-            assertFalse(seda.isEnabled());
+            hc = healthCheckRegistry.getCheck("myseda").get();
+            assertTrue(hc.isEnabled());
+            assertTrue(healthCheckRegistry.isExcluded(hc));
         } finally {
             main.stop();
         }
     }
 
     @Test
-    public void testMainBasicHealthCheckConfiguration() {
+    public void testMainBasicHealthCheckRegistry() {
         Main main = new Main();
         main.configure().addRoutesBuilder(new Routes());
-        main.addInitialProperty("camel.health.config[custom].parent", 
"registry-health-check-repository");
-        main.addInitialProperty("camel.health.config[custom].enabled", 
"false");
+        main.addInitialProperty("camel.health.exclude-pattern", "custom");
 
         main.start();
         try {
             CamelContext camelContext = main.getCamelContext();
             assertNotNull(camelContext);
 
+            final AtomicBoolean invoked = new AtomicBoolean();
             HealthCheck healthCheck = new AbstractHealthCheck("custom") {
                 @Override
                 protected void doCall(HealthCheckResultBuilder builder, 
Map<String, Object> options) {
-                    // Noop
+                    invoked.set(true);
                 }
             };
 
-            // This configuration will be overridden by the camel-main config 
properties
-            healthCheck.getConfiguration().setEnabled(true);
+            // register custom health check
             camelContext.getRegistry().bind("custom", healthCheck);
 
             HealthCheckRegistry healthCheckRegistry = 
camelContext.getExtension(HealthCheckRegistry.class);
@@ -115,10 +108,54 @@ public class MainHealthCheckConfigTest {
             List<HealthCheck> healthChecks = 
registryRepository.stream().collect(Collectors.toList());
             assertEquals(1, healthChecks.size());
 
-            HealthCheck myCustomCheck = healthChecks.get(0);
-            HealthCheckConfiguration configuration = 
myCustomCheck.getConfiguration();
-            assertNotNull(configuration);
-            assertFalse(configuration.isEnabled());
+            assertTrue(healthCheckRegistry.getCheck("custom").isPresent());
+
+            // custom is excluded
+            HealthCheckHelper.invoke(camelContext);
+            assertFalse(invoked.get());
+        } finally {
+            main.stop();
+        }
+    }
+
+    @Test
+    public void testMainBasicHealthCheckAdded() {
+        Main main = new Main();
+        main.configure().addRoutesBuilder(new Routes());
+        main.addInitialProperty("camel.health.exclude-pattern", "custom");
+
+        main.start();
+        try {
+            CamelContext camelContext = main.getCamelContext();
+            assertNotNull(camelContext);
+
+            final AtomicBoolean invoked = new AtomicBoolean();
+            HealthCheck healthCheck = new AbstractHealthCheck("custom") {
+                @Override
+                protected void doCall(HealthCheckResultBuilder builder, 
Map<String, Object> options) {
+                    invoked.set(true);
+                }
+            };
+
+            HealthCheckRegistry healthCheckRegistry = 
camelContext.getExtension(HealthCheckRegistry.class);
+            assertNotNull(healthCheckRegistry);
+
+            List<HealthCheck> healthChecks = 
healthCheckRegistry.stream().collect(Collectors.toList());
+            int before = healthChecks.size();
+
+            // register custom health check which should be excluded
+            boolean added = healthCheckRegistry.register(healthCheck);
+            assertTrue(added);
+
+            healthChecks = 
healthCheckRegistry.stream().collect(Collectors.toList());
+            int after = healthChecks.size();
+            assertEquals(before + 1, after);
+
+            assertTrue(healthCheckRegistry.getCheck("custom").isPresent());
+
+            // custom is excluded
+            HealthCheckHelper.invoke(camelContext);
+            assertFalse(invoked.get());
         } finally {
             main.stop();
         }
@@ -128,8 +165,11 @@ public class MainHealthCheckConfigTest {
 
         @Override
         public void configure() throws Exception {
-            from("direct:start").to("log:direct");
-            from("seda:start").to("log:seda");
+            from("direct:start").routeId("mydirect")
+                    .to("log:direct");
+
+            from("seda:start").routeId("myseda")
+                    .to("log:seda");
         }
     }
 }
diff --git 
a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedCamelHealth.java
 
b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedCamelHealth.java
index b76f851..88add64 100644
--- 
a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedCamelHealth.java
+++ 
b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedCamelHealth.java
@@ -138,7 +138,7 @@ public class ManagedCamelHealth implements 
ManagedCamelHealthMBean {
                                 result.getCheck().getId(),
                                 result.getCheck().getGroup(),
                                 result.getState().name(),
-                                
result.getCheck().getConfiguration().isEnabled(),
+                                result.getCheck().isEnabled(),
                                 result.getMessage().orElse(""),
                                 failureUri,
                                 failureCount,
@@ -167,7 +167,7 @@ public class ManagedCamelHealth implements 
ManagedCamelHealthMBean {
     public void enableById(String id) {
         Optional<HealthCheck> hc = healthCheckRegistry.getCheck(id);
         if (hc.isPresent()) {
-            hc.get().getConfiguration().setEnabled(true);
+            hc.get().setEnabled(true);
         } else {
             Optional<HealthCheckRepository> hcr = 
healthCheckRegistry.getRepository(id);
             hcr.ifPresent(repository -> repository.setEnabled(true));
@@ -178,7 +178,7 @@ public class ManagedCamelHealth implements 
ManagedCamelHealthMBean {
     public void disableById(String id) {
         Optional<HealthCheck> hc = healthCheckRegistry.getCheck(id);
         if (hc.isPresent()) {
-            hc.get().getConfiguration().setEnabled(false);
+            hc.get().setEnabled(false);
         } else {
             Optional<HealthCheckRepository> hcr = 
healthCheckRegistry.getRepository(id);
             hcr.ifPresent(repository -> repository.setEnabled(false));
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumerHealthCheck.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumerHealthCheck.java
index 3fff81f..5f5129e 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumerHealthCheck.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumerHealthCheck.java
@@ -19,7 +19,6 @@ package org.apache.camel.support;
 import java.util.Map;
 
 import org.apache.camel.health.HealthCheck;
-import org.apache.camel.health.HealthCheckConfiguration;
 import org.apache.camel.health.HealthCheckResultBuilder;
 import org.apache.camel.util.URISupport;
 
@@ -32,6 +31,7 @@ public class ScheduledPollConsumerHealthCheck implements 
HealthCheck {
     private final String id;
     private final String sanitizedBaseUri;
     private final String sanitizedUri;
+    private boolean enabled = true;
     private boolean downBeforeFirstPoll = true;
 
     public ScheduledPollConsumerHealthCheck(ScheduledPollConsumer consumer, 
String id) {
@@ -42,8 +42,13 @@ public class ScheduledPollConsumerHealthCheck implements 
HealthCheck {
     }
 
     @Override
-    public HealthCheckConfiguration getConfiguration() {
-        throw new UnsupportedOperationException("Configuration is not in use 
for this kind of health-check");
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    @Override
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
     }
 
     @Override
@@ -54,6 +59,12 @@ public class ScheduledPollConsumerHealthCheck implements 
HealthCheck {
         builder.detail(ENDPOINT_URI, sanitizedUri);
         builder.detail(FAILURE_ENDPOINT_URI, sanitizedUri);
 
+        if (!isEnabled()) {
+            builder.message("Disabled");
+            builder.detail(CHECK_ENABLED, false);
+            return builder.unknown().build();
+        }
+
         long ec = consumer.getErrorCounter();
         boolean first = consumer.isFirstPollDone();
         Throwable cause = consumer.getLastError();
diff --git 
a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_16.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_16.adoc
index ff26a48..b7c8e49 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_16.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_16.adoc
@@ -63,6 +63,34 @@ These options would complicate health checks as they affect 
the outcome of healt
 It is better the checks always execute and the responsibility of the 
monitoring systems
 how to deal with interval between checks and thresholds.
 
+==== Disabling health checks
+
+The configuration for disabling individual health-checks has changed
+
+Before each health-check could be configured and set `enabled=false`. For 
example
+to disable health-checks for route with id `netty` you would do:
+
+[source,properties]
+----
+camel.health.config[netty].check = routes
+camel.health.config[netty].enabled = false
+----
+
+With Camel 3.16 onwards you instead specify pattern(s) for health checks to be 
excluded
+from being invoked, which is done in a single configuration:
+
+[source,properties]
+----
+camel.health.exclude-pattern = netty
+----
+
+You can specify multiple patterns (and use wildcards) such as:
+
+[source,properties]
+----
+camel.health.exclude-pattern = netty,foo,bar*
+----
+
 === camel-main
 
 The option `camel.main.packageScanRouteBuilders` has been renamed to 
`camel.main.basePackageScan`.
diff --git a/docs/user-manual/modules/ROOT/pages/health-check.adoc 
b/docs/user-manual/modules/ROOT/pages/health-check.adoc
index 2f331af..6baa8de 100644
--- a/docs/user-manual/modules/ROOT/pages/health-check.adoc
+++ b/docs/user-manual/modules/ROOT/pages/health-check.adoc
@@ -51,17 +51,6 @@ public boolean isReadiness() {
 }
 ----
 
-== Health Check configuration
-
-The `HealthCheckConfiguration` has the following options:
-
-[%header,cols=3*]
-|====
-| Name | Default | Description
-| parent |  | The parent group this health check belongs to, such as context, 
routes, or consumers.
-| enabled | true | Set if the check associated to this configuration is 
enabled or not.
-|====
-
 == Configuring health-check
 
 Camel supports via `camel-main` to configure health-checks from configuration 
files. This is possible for runtimes that leverage `camel-main`
@@ -83,28 +72,22 @@ camel.health.consumersEnabled=false
 camel.health.registryEnabled=false
 ----
 
-=== Configuring routes health-check
+=== Excluding health-checks
 
-The `routes` health check supports filtering by route id, or endpoint uri 
using a pattern style (* as wildcard, and regexp supported).
-For example to turn off all routes that are from kafka, you can do:
+By default, all enabled health-checks are invoked by Camel when check the 
health status.
 
-NOTE: Notice the syntax is a map `[]` where the key is the route id pattern. 
It's important to set the `parent`
-option to refer to what health-check this configuration applies for such as 
`routes` or `registry`.
+It is possible to specify checks that should be excluded, for example a 
specific route by the route-id.
 
 [source,properties]
 ----
-camel.health.config[kafka*].parent=routes
-camel.health.config[kafka*].enabled=false
+camel.health.exclude-pattern = myroute
 ----
 
-It's possible to set a default fallback configuration using `[*]` as the route 
id:
+You can specify multiple patterns (and use wildcards) such as:
 
 [source,properties]
 ----
-camel.health.config[kafka*].parent=routes
-camel.health.config[kafka*].enabled=false
-camel.health.config[*].parent=routes
-camel.health.config[*].enabled=true
+camel.health.exclude-pattern = myroute,foo,bar*
 ----
 
 === Turning off consumer level health-checks
@@ -119,16 +102,14 @@ The consumer checks can be turned off, to only use the 
route level checks (statu
 camel.health.consumersEnabled=false
 ----
 
-You can also turn off individual consumers by prefixing the ID with 
`consumer:` such as:
+You can also turn off individual consumers by prefixing the ID with 
`consumer:` and the route id:
 
 [source,properties]
 ----
-camel.health.config[consumer:kafka*].parent=consumers
-camel.health.config[consumer:kafka*].enabled=false
+camel.health.exclude-pattern = consumer:myroute*
 ----
 
-which will turn off checks for all consumers on routes that starts with 
`kafka` in the route ID.
-
+which will turn off checks for all consumers on routes that starts with 
`myroute` in the route ID.
 
 == JMX management
 

Reply via email to