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 2021/11/29 10:46:23 UTC

[camel] 04/04: CAMEL-17141: camel-health - Include error details for HTTP status code.

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

commit 1de2c6ef3a7789abe0d1ddc57ae29cc2b65b85e7
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Nov 29 11:45:45 2021 +0100

    CAMEL-17141: camel-health - Include error details for HTTP status code.
---
 .../java/org/apache/camel/support/ScheduledPollConsumer.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

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 d0be2cc..60552bf 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
@@ -79,7 +79,7 @@ public abstract class ScheduledPollConsumer extends DefaultConsumer
     private volatile Throwable lastError;
     private volatile Map<String, Object> lastErrorDetails;
     private final AtomicLong counter = new AtomicLong();
-    private final AtomicBoolean firstPoolDone = new AtomicBoolean();
+    private volatile boolean firstPoolDone;
 
     public ScheduledPollConsumer(Endpoint endpoint, Processor processor) {
         super(endpoint, processor);
@@ -276,8 +276,8 @@ public abstract class ScheduledPollConsumer extends DefaultConsumer
             lastErrorDetails = null;
         }
 
-        // first pool is done after starting
-        firstPoolDone.set(true);
+        // now first pool is done after the poll is complete
+        firstPoolDone = true;
 
         LOG.trace("doRun() done with idleCounter={}, successCounter={}, errorCounter={}", idleCounter, successCounter,
                 errorCounter);
@@ -480,7 +480,7 @@ public abstract class ScheduledPollConsumer extends DefaultConsumer
      * Whether a first pool attempt has been done (also if the consumer has been restarted)
      */
     protected boolean isFirstPoolDone() {
-        return firstPoolDone.get();
+        return firstPoolDone;
     }
 
     /**
@@ -627,7 +627,7 @@ public abstract class ScheduledPollConsumer extends DefaultConsumer
         errorCounter = 0;
         successCounter = 0;
         counter.set(0);
-        firstPoolDone.set(false);
+        firstPoolDone = false;
 
         super.doStop();
     }