Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Status

Current stateUnder Discussion

...

JIRA: KAFKA-7402 [Change the link from KAFKA-1 to your own ticket]

Motivation

Quoting John John Roesler:

...

* An object that may hold resources (such as file or socket handles)
* until it is closed. The {@link #close()} method of an {@code AutoCloseable}
* object is called automatically when exiting a {@code
* try}-with-resources block for which the object has been declared in
* the resource specification header. This construction ensures prompt
* release, avoiding resource exhaustion exceptions and errors that
* may otherwise occur.

Public Interfaces

By going over the project, here is a list that I found which can implement AutoCloseable. Suggestions are welcome.

  1. org.apache.kafka.streams.KafkaStreams
  2. org.apache.kafka.connect.runtime.ConnectMetrics.MetricGroup
  3. org.apache.kafka.tools.VerifiableProducer

Proposed Changes

Changes are similar to this:

Code Block


public class KafkaStreams implements AutoCloseable{
...
public void close()
...
}

.

Compatibility, Deprecation, and Migration Plan

  • N/A