davsclaus commented on a change in pull request #6292:
URL: https://github.com/apache/camel/pull/6292#discussion_r730922524



##########
File path: 
components/camel-kafka/src/main/java/org/apache/camel/component/kafka/DefaultKafkaManualCommit.java
##########
@@ -70,6 +83,26 @@ protected void commitOffset(StateRepository<String, String> 
offsetRepository, To
         }
     }
 
+    protected void commitAsyncOffset(
+            StateRepository<String, String> offsetRepository, TopicPartition 
partition, long recordOffset) {
+        if (recordOffset != -1) {
+            if (offsetRepository != null) {
+                offsetRepository.setState(serializeOffsetKey(partition), 
serializeOffsetValue(recordOffset));
+            } else {
+                LOG.debug("CommitAsync {} from topic {} with offset: {}", 
threadId, topicName, recordOffset);
+                consumer.commitAsync(Collections.singletonMap(partition, new 
OffsetAndMetadata(recordOffset + 1)),
+                        (offsets, exception) -> {
+                            if (exception != null) {
+                                LOG.error("Error during async commit: ", 
exception);
+                            } else {
+                                LOG.info("CommitAsync done for {} from topic 
{} with offset: {}", threadId, topicName,

Review comment:
       Reduce logging noise as INFO is too verbose, use DEBUG or TRACE

##########
File path: 
components/camel-kafka/src/main/java/org/apache/camel/component/kafka/DefaultKafkaManualCommit.java
##########
@@ -70,6 +83,26 @@ protected void commitOffset(StateRepository<String, String> 
offsetRepository, To
         }
     }
 
+    protected void commitAsyncOffset(
+            StateRepository<String, String> offsetRepository, TopicPartition 
partition, long recordOffset) {
+        if (recordOffset != -1) {
+            if (offsetRepository != null) {
+                offsetRepository.setState(serializeOffsetKey(partition), 
serializeOffsetValue(recordOffset));
+            } else {
+                LOG.debug("CommitAsync {} from topic {} with offset: {}", 
threadId, topicName, recordOffset);
+                consumer.commitAsync(Collections.singletonMap(partition, new 
OffsetAndMetadata(recordOffset + 1)),
+                        (offsets, exception) -> {
+                            if (exception != null) {
+                                LOG.error("Error during async commit: ", 
exception);

Review comment:
       You can maybe add more details to this error message about topic, offset 
etc




-- 
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-unsubscr...@camel.apache.org

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


Reply via email to