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