This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch camel-3.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.21.x by this push:
new 2935a5d966d CAMEL-20092: reset error counter before greedy poll
(#11937) (#11950)
2935a5d966d is described below
commit 2935a5d966db51f8953ddf3827e645d494210fd7
Author: Simon Oxenvad Rasmussen <[email protected]>
AuthorDate: Thu Nov 9 11:46:26 2023 +0100
CAMEL-20092: reset error counter before greedy poll (#11937) (#11950)
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 c12bfc67158..d3a611cb984 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
@@ -214,6 +214,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;
}