KIP-596 — Safely abort Producer transactions during application shutdown
Discussion TransactionsProducer
Adds a `close(Duration timeout)` overload to `KafkaProducer` that automatically calls `abortTransaction()` when the producer is in a non-recoverable error state before closing, instead of requiring users to manually invoke `abortTransaction` inside a nested try-catch. The existing error handling pattern for transactional producers is complex because `abortTransaction()` itself can throw if the producer is already fenced or in a fatal state.
Details
| Author | Xiang Zhang |
| Status | Discussion |
| JIRA | KAFKA-9592 |
| Wiki | View on Apache Wiki |
| Created | 2020-04-14 |
| Last Modified | 2020-05-15 |
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.