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 ca6c5b9  CAMEL-16640 camel-kafka race conditions during shut down 
(#5593)
ca6c5b9 is described below

commit ca6c5b97bea85bd2abf38daccd88aa39640831f7
Author: Ehsan Amiryousefi <[email protected]>
AuthorDate: Fri May 21 15:14:45 2021 +0200

    CAMEL-16640 camel-kafka race conditions during shut down (#5593)
    
    Co-authored-by: I540738 <[email protected]>
---
 .../src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
index 3336f19..ec1a8dc 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
@@ -234,6 +234,10 @@ public class KafkaConsumer extends DefaultConsumer {
 
                 first = false;
 
+                if (!isRunAllowed() || isStoppingOrStopped() || 
isSuspendingOrSuspended()) {
+                    return;
+                }
+
                 // doRun keeps running until we either shutdown or is told to 
re-connect
                 doRun(reTry, reConnect);
             }

Reply via email to