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/03/28 11:49:21 UTC

[GitHub] [camel] rgala commented on a change in pull request #7275: CAMEL-17802: remove the autoCommitOnStop because the consumer already auto-commits on the call to close

rgala commented on a change in pull request #7275:
URL: https://github.com/apache/camel/pull/7275#discussion_r836341710



##########
File path: components/camel-kafka/src/main/java/org/apache/camel/component/kafka/consumer/CommitManagers.java
##########
@@ -34,13 +34,7 @@ public static CommitManager createCommitManager(
         }
 
         if (configuration.isAutoCommitEnable()) {
-            if ("async".equals(configuration.getAutoCommitOnStop())) {
-                return new AsyncCommitManager(consumer, kafkaConsumer, threadId, printableTopic);
-            } else if ("sync".equals(configuration.getAutoCommitOnStop())) {
-                return new SyncCommitManager(consumer, kafkaConsumer, threadId, printableTopic);
-            } else if ("none".equals(configuration.getAutoCommitOnStop())) {
-                return new NoopCommitManager(consumer, kafkaConsumer, threadId, printableTopic);
-            }
+            return new AsyncCommitManager(consumer, kafkaConsumer, threadId, printableTopic);

Review comment:
       I don't think it is needed because no matter what the commit manager does, the offset will be handled automatically on consumer close. Wouldn't it be better to return NoopCommitManager here?




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