conduktor.io ↗

KIP-376 — Implement AutoClosable on appropriate classes that want to be used in a try-with-resource statement

Accepted Kafka 2.2 Client

KIP-376 makes `KafkaStreams`, `KafkaChannel`, `ConsumerInterceptor`, `MetricsReporter`, and several other Kafka and Streams components implement `java.lang.AutoCloseable` so they can be used in try-with-resources blocks. These classes hold resources and have `close()` methods but did not implement the interface, preventing resource-safe usage patterns and complicating test teardown.

Details

AuthorYishun Guan
StatusAccepted
Kafka Version2.2
JIRAKAFKA-7402
WikiView on Apache Wiki
Created2018-09-25
Last Modified2018-11-17
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.