This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch camel-4.0.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.0.x by this push:
new a56125fef6d CAMEL-20092: reset error counter before greedy poll
(#11937) (#11948)
a56125fef6d is described below
commit a56125fef6d3d79e7baece34b82deff6ca47c3c0
Author: Simon Oxenvad Rasmussen <[email protected]>
AuthorDate: Thu Nov 9 11:46:19 2023 +0100
CAMEL-20092: reset error counter before greedy poll (#11937) (#11948)
ScheduledPollConsumerHealthCheck uses the error count to determine if
the consumer is healthly or not. After polling messages, we know that
the consumer is healthy, and it is safe to reset the error markers.
---
.../main/java/org/apache/camel/support/ScheduledPollConsumer.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git
a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java
b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java
index a22d5517347..772c94e1116 100644
---
a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java
+++
b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java
@@ -215,6 +215,12 @@ public abstract class ScheduledPollConsumer extends
DefaultConsumer
retryCounter = -1;
LOG.trace("Greedy polling after processing {}
messages", polledMessages);
+ // clear any error that might be since we have
successfully polled, otherwise readiness checks might believe the
+ // consumer to be unhealthy
+ errorCounter = 0;
+ lastError = null;
+ lastErrorDetails = null;
+
// setting firstPollDone to true if greedy
polling is enabled
firstPollDone = true;
}