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
| Author | Ismael Juma |
| Status | Discussion |
| JIRA | KAFKA-12227 |
| Wiki | View on Apache Wiki |
| Created | 2019-01-20 |
| Last Modified | 2021-04-06 |
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.