philipnee commented on code in PR #13303:
URL: https://github.com/apache/kafka/pull/13303#discussion_r1127256908


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/PrototypeAsyncConsumer.java:
##########
@@ -226,11 +246,20 @@ public void commitAsync(OffsetCommitCallback callback) {
 
     @Override
     public void commitAsync(Map<TopicPartition, OffsetAndMetadata> offsets, 
OffsetCommitCallback callback) {
-        final CommitApplicationEvent commitEvent = new 
CommitApplicationEvent(offsets);
-        commitEvent.future().whenComplete((r, t) -> {
-            callback.onComplete(offsets, new RuntimeException(t));
+        CompletableFuture<Void> future = commit(offsets);
+        future.whenComplete((r, t) -> {
+            if (t != null) {
+                callback.onComplete(offsets, new RuntimeException(t));
+            } else {
+                callback.onComplete(offsets, null);
+            }
         });
+    }
+
+    private CompletableFuture<Void> commit(Map<TopicPartition, 
OffsetAndMetadata> offsets) {

Review Comment:
   Thanks, for 1 - I think I actually wanted to say commitSync(), sorry about 
that.
   
   I think they aren't part of the existing interface, right? Currently, both 
commitSync and poll don't return a future, and I was wondering if it makes 
sense for us to do that.  Also, it makes the interface feels more modern.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to