lucasbru commented on code in PR #15000: URL: https://github.com/apache/kafka/pull/15000#discussion_r1431712362
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java: ########## @@ -757,6 +757,14 @@ public void commitAsync(Map<TopicPartition, OffsetAndMetadata> offsets, OffsetCo try { CompletableFuture<Void> future = commit(offsets, false); future.whenComplete((r, t) -> { + if (t == null && interceptors != null) { + invoker.submit(new OffsetCommitCallbackTask( Review Comment: Original KIP https://cwiki.apache.org/confluence/display/KAFKA/KIP-42%3A+Add+Producer+and+Consumer+Interceptors states: > onCommit() will be called when offsets get committed: just before OffsetCommitCallback.onCompletion() is called and in ConsumerCoordinator.commitOffsetsSync() on successful commit. > > Since new consumer is single-threaded, ConsumerInterceptor API will be called from a single thread. Since interceptor callbacks are called for every record, the interceptor implementation should be careful about adding performance overhead to consumer. That's why I implemented it using the Invoker. -- 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