You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/10/12 06:32:17 UTC

[camel] branch main updated: [camel-18588] Added condition to only commit offset if it is not alreday paused

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

orpiske 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 39cf0da1730 [camel-18588] Added condition to only commit offset if it is not alreday paused
39cf0da1730 is described below

commit 39cf0da17308c3bf043467907ea20a0681ecda08
Author: geekr <ge...@gmail.com>
AuthorDate: Tue Oct 11 15:01:11 2022 -0400

    [camel-18588] Added condition to only commit offset if it is not alreday paused
---
 .../java/org/apache/camel/component/kafka/KafkaFetchRecords.java     | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java
index 6e482a1df64..079a14615ab 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java
@@ -319,8 +319,8 @@ public class KafkaFetchRecords implements Runnable {
                 }
 
                 ProcessingResult result = recordProcessorFacade.processPolledRecords(allRecords, lastResult);
-
-                if (result.isBreakOnErrorHit()) {
+                updateTaskState();
+                if (result.isBreakOnErrorHit() && !this.state.equals(State.PAUSED)) {
                     LOG.debug("We hit an error ... setting flags to force reconnect");
                     // force re-connect
                     setReconnect(true);
@@ -329,7 +329,6 @@ public class KafkaFetchRecords implements Runnable {
                     lastResult = result;
                 }
 
-                updateTaskState();
             }
 
             if (!isConnected()) {