KIP-514 — Add a bounded flush() API to Kafka Producer
Discussion Producer
Adds a `Producer.flush(long timeout, TimeUnit unit)` overload that blocks until all buffered records are sent or the timeout expires, throwing `TimeoutException` on expiry. The existing `flush()` has no timeout, meaning it can block indefinitely if the broker is slow or network connectivity is degraded, giving callers no ability to bound flush duration.
Details
| Author | kun du |
| Status | Discussion |
| JIRA | KAFKA-7711 |
| Wiki | View on Apache Wiki |
| Created | 2019-08-27 |
| Last Modified | 2019-10-21 |
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.