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 14:13:44 UTC

[GitHub] [camel] davsclaus 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

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


##########
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:
   Also the code should be formatted, you can do that with `mvn compile -P format`



-- 
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