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 24433ab  CAMEL-15081: camel-health - Allow to configure from camel-main
24433ab is described below

commit 24433abd37820708331a6b29f23dcb086f9f7e49
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Fri May 29 14:20:48 2020 +0200

    CAMEL-15081: camel-health - Allow to configure from camel-main
---
 .../org/apache/camel/main/DefaultConfigurationConfigurer.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
index 6d9b968..b15775b 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
@@ -214,15 +214,18 @@ public final class DefaultConfigurationConfigurer {
 
         // health check
         HealthCheckRegistry hc = 
camelContext.getExtension(HealthCheckRegistry.class);
-        if (hc != null) {
-            hc.setEnabled(config.isHealthCheckEnabled());
+        if (hc != null && config.isHealthCheckEnabled()) {
+            // register context health-check by default
+            Object context = hc.resolveById("context");
+            if (context != null) {
+                hc.register(context);
+            }
+            // register routes if enabled
             if (config.isHealthCheckRoutesEnabled()) {
                 Object routes = hc.resolveById("routes");
                 if (routes != null) {
                     hc.register(routes);
                 }
-            } else {
-                hc.unregister("routes");
             }
         }
     }

Reply via email to