This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new b59b009  CAMEL-16413: camel-kafka - KafkaConsumer should not during 
stopping/shutdown force commit offset if partiotion is revoked event is 
triggered, but commit accordingly to autoCommitOnStop configuration.
b59b009 is described below

commit b59b009c914e56e3b6942c06947726f6388ad824
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Wed Mar 31 15:08:14 2021 +0200

    CAMEL-16413: camel-kafka - KafkaConsumer should not during 
stopping/shutdown force commit offset if partiotion is revoked event is 
triggered, but commit accordingly to autoCommitOnStop configuration.
---
 .../src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 f25fee0..9a97dde 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
@@ -601,8 +601,8 @@ public class KafkaConsumer extends DefaultConsumer {
         public void onPartitionsRevoked(Collection<TopicPartition> partitions) 
{
             LOG.debug("onPartitionsRevoked: {} from topic {}", threadId, 
topicName);
 
-            // if camel is stopping or we are stopping then the commit offset 
needs to be handled specially
-            boolean stopping = getEndpoint().getCamelContext().isStopping() || 
isStoppingOrStopped();
+            // if camel is stopping, or we are not running
+            boolean stopping = getEndpoint().getCamelContext().isStopping() && 
!isRunAllowed();
 
             StateRepository<String, String> offsetRepository = 
endpoint.getConfiguration().getOffsetRepository();
             for (TopicPartition partition : partitions) {

Reply via email to