You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/10/10 07:12:14 UTC

[GitHub] [camel] orpiske commented on a diff in pull request #8499: [camel-18588] Added condition around commitManager.forceCommit method to not reset from zero if there is no information on the last offset committed

orpiske commented on code in PR #8499:
URL: https://github.com/apache/camel/pull/8499#discussion_r990967060


##########
components/camel-kafka/src/main/java/org/apache/camel/component/kafka/consumer/support/KafkaRecordProcessor.java:
##########
@@ -131,8 +131,11 @@ private boolean processException(
                 LOG.warn("Will seek consumer to offset {} and start polling again.", partitionLastOffset);
             }
 
-            // force commit, so we resume on next poll where we failed
-            commitManager.forceCommit(partition, partitionLastOffset);
+            // force commit, so we resume on next poll where we failed except when the failure happened
+            // at the first message in a poll
+            if(partitionLastOffset != -1) {

Review Comment:
   Please use `AbstractCommitManager.START_OFFSET` instead of -1, so it's easier to read. 
   
   
   Thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org