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/01/08 10:06:48 UTC
[camel] branch main updated: CAMEL-17427: Some scheduled consumers should be regarded as UP in their health-check from initial phase such as spring cron scheduler.
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 3f1de5a CAMEL-17427: Some scheduled consumers should be regarded as UP in their health-check from initial phase such as spring cron scheduler.
3f1de5a is described below
commit 3f1de5a28a4c5e42780714e7bc8e8c8e8731e40e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Jan 8 11:05:19 2022 +0100
CAMEL-17427: Some scheduled consumers should be regarded as UP in their health-check from initial phase such as spring cron scheduler.
---
.../java/org/apache/camel/component/cron/SpringCronConsumer.java | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/components/camel-spring/src/main/java/org/apache/camel/component/cron/SpringCronConsumer.java b/components/camel-spring/src/main/java/org/apache/camel/component/cron/SpringCronConsumer.java
index e60ad73..d1a9744 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/component/cron/SpringCronConsumer.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/component/cron/SpringCronConsumer.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.cron;
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
+import org.apache.camel.health.HealthCheck;
import org.apache.camel.support.ScheduledPollConsumer;
public class SpringCronConsumer extends ScheduledPollConsumer {
@@ -33,4 +34,10 @@ public class SpringCronConsumer extends ScheduledPollConsumer {
getProcessor().process(exchange);
return 1;
}
+
+ @Override
+ protected HealthCheck.State initialHealthCheckState() {
+ // the spring cron should be regarded as healthy on startup
+ return HealthCheck.State.UP;
+ }
}