conduktor.io ↗

KIP-706 — Add method "Producer#send" to return CompletionStage instead of Future

Discussion Producer

Adds a `sendAsync()` method to the `Producer` interface that returns `CompletionStage<RecordMetadata>` instead of `Future<RecordMetadata>`, and deprecates the existing `send()` methods. `Future`'s limited API makes it difficult to write non-blocking asynchronous producer code; `CompletionStage` (available since Java 8) supports chaining, composition, and integration with async frameworks.

Details

AuthorIsmael Juma
StatusDiscussion
JIRAKAFKA-12227
WikiView on Apache Wiki
Created2019-01-20
Last Modified2021-04-06
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.