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 2022/02/07 10:10:23 UTC

[camel-spring-boot] branch main updated: CAMEL-17587: camel-health - Make Health Check API simpler

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-spring-boot.git


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

commit 8d10d747dc3896530aea613dc12805049e24a490
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Feb 7 11:05:59 2022 +0100

    CAMEL-17587: camel-health - Make Health Check API simpler
---
 .../src/main/docs/spring-boot.json                 | 12 --------
 .../health/CamelHealthCheckAutoConfiguration.java  |  2 --
 .../CamelHealthCheckConfigurationProperties.java   | 32 ----------------------
 3 files changed, 46 deletions(-)

diff --git a/core/camel-spring-boot/src/main/docs/spring-boot.json b/core/camel-spring-boot/src/main/docs/spring-boot.json
index 6c83108..7409d1e 100644
--- a/core/camel-spring-boot/src/main/docs/spring-boot.json
+++ b/core/camel-spring-boot/src/main/docs/spring-boot.json
@@ -407,18 +407,6 @@
       "sourceType": "org.apache.camel.spring.boot.actuate.health.CamelHealthCheckConfigurationProperties$HealthCheckConfigurationProperties"
     },
     {
-      "name": "camel.health.config.failure-threshold",
-      "type": "java.lang.Integer",
-      "description": "Set the number of failure before reporting the service as un-healthy.",
-      "sourceType": "org.apache.camel.spring.boot.actuate.health.CamelHealthCheckConfigurationProperties$HealthCheckConfigurationProperties"
-    },
-    {
-      "name": "camel.health.config.interval",
-      "type": "java.lang.Long",
-      "description": "Set the check interval in milli seconds.",
-      "sourceType": "org.apache.camel.spring.boot.actuate.health.CamelHealthCheckConfigurationProperties$HealthCheckConfigurationProperties"
-    },
-    {
       "name": "camel.health.config.parent",
       "type": "java.lang.String",
       "description": "The id of the health check such as routes or registry (can use * as wildcard)",
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckAutoConfiguration.java
index d349c47..9edac6d 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckAutoConfiguration.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckAutoConfiguration.java
@@ -130,8 +130,6 @@ public class CamelHealthCheckAutoConfiguration {
                 if (hc instanceof HealthCheck) {
                     ((HealthCheck) hc).getConfiguration().setParent(hcc.getParent());
                     ((HealthCheck) hc).getConfiguration().setEnabled(hcc.getEnabled() != null ? hcc.getEnabled() : true);
-                    ((HealthCheck) hc).getConfiguration().setFailureThreshold(hcc.getFailureThreshold());
-                    ((HealthCheck) hc).getConfiguration().setInterval(hcc.getInterval());
                 } else if (hc instanceof HealthCheckRepository) {
                     ((HealthCheckRepository) hc).addConfiguration(id, hcc.toHealthCheckConfiguration());
                 }
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckConfigurationProperties.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckConfigurationProperties.java
index 435161c..5ab08b8 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckConfigurationProperties.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckConfigurationProperties.java
@@ -128,16 +128,6 @@ public class CamelHealthCheckConfigurationProperties {
          */
         private Boolean enabled;
 
-        /**
-         * Set the check interval in milli seconds.
-         */
-        private Long interval;
-
-        /**
-         * Set the number of failure before reporting the service as un-healthy.
-         */
-        private Integer failureThreshold;
-
         public String getParent() {
             return parent;
         }
@@ -154,34 +144,12 @@ public class CamelHealthCheckConfigurationProperties {
             this.enabled = enabled;
         }
 
-        public Long getInterval() {
-            return interval;
-        }
-
-        public void setInterval(Long interval) {
-            this.interval = interval;
-        }
-
-        public Integer getFailureThreshold() {
-            return failureThreshold;
-        }
-
-        public void setFailureThreshold(Integer failureThreshold) {
-            this.failureThreshold = failureThreshold;
-        }
-
         public HealthCheckConfiguration toHealthCheckConfiguration() {
             HealthCheckConfiguration answer = new HealthCheckConfiguration();
             answer.setParent(parent);
             if (enabled != null) {
                 answer.setEnabled(enabled);
             }
-            if (interval != null) {
-                answer.setInterval(interval);
-            }
-            if (failureThreshold != null) {
-                answer.setFailureThreshold(failureThreshold);
-            }
             return answer;
         }
     }