Hey folks -- I think this is a good conversation. Given we plan to drop support for Java 8 in 4.0 this seems like a good time to consider this change. Perhaps we should file a JIRA ticket and maybe create a KIP to discuss?
One thing we should consider however, is if we want some of these operations to be asynchronous. I know I got into some tricky areas of Kafka recently that assumed operations completed in a given order so it is good to confirm such changes are safe. Looking forward to further discussion, Justine On Tue, Jan 2, 2024 at 1:14 PM Philip Nee <philip...@gmail.com> wrote: > hey sean - a lot of uses of the Futures are in the public API and therefore > take voting/effort to be changed. i don't know any reason for > intentionally avoiding the use of CompletableFuture, however, others might > know more than I do. > > thanks, > P > > On Tue, Nov 14, 2023 at 1:27 AM 신수웅(Sean Sin) <working...@gmail.com> > wrote: > > > Dear Apache Kakfa Developers, > > > > I'm 4-year SWE in South Korea. > > I have some questions while watching Kafka Producer API. > > > > *Why Use "Future" and Not "CompletableFuture"?* > > > > In the case of "Future", blocking occurs when calling "*get()*", so I > > thought "Computable Future" would be better when doing more asynchronous > > operations. > > > > I looked at the Java API document > > < > > > https://kafka.apache.org/36/javadoc/org/apache/kafka/common/KafkaFuture.html#thenApply(org.apache.kafka.common.KafkaFuture.BaseFunction) > > > > > based on the latest version, version 3.6.x. > > > > If you look at that version, you can see that the Future object provides > > the "toCompletionStage() "method, which can convert "KafkaFuture" to > > "ComputableFuture". > > > > In response to this, I think that in the initial design decision process, > > we considered compatibility issues under JDK 1.8 and the level of > knowledge > > of the learning curve or developer when introducing ComputableFuture, > but I > > wonder if this is correct. > > > > In addition, I wonder if it is recommended to use the > "toCompletionStage()" > > method to produce more non-blocking if we assume JDK 1.8 or higher. > > > > Thanks. > > Su-Ung Shin. > > >