Versions Compared

Key

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

...

A new `Admin` interface will be added, (naming inline with the client interfaces `Consumer` and `Producer`). The interface will define all the methods the `AdminClient` class currently defines, with default implementations where necessary, with the exception of the static factory methods for creating new instances, which will be made available on a new `AdminClients` utility class.

The existing `AdminClient` abstract class will be changed to implement the new `Admin` interface and its own implementation remove.  It's static `create` factory methods will call into the new `AdminClients` utility class.The existing `AdminClient` will be marked as deprecated.  

All use of `AdminClient` within the Kafka project will be replaced with use of the `Admin` interface and `AdminClients` utility class, with the exception of any classes extending the abstract class, (`KafkaAdminClient` and `MockAdminClient`), which will continue to do so to maintain backwards compatibility until the next major release.

Proposed Changes

As per section above, use of the `AdminClient` abstract base class will be deprecated in favour of a new Kafka `Admin` interface and `AdminClients` utility class.

Compatibility, Deprecation, and Migration Plan

Adding the interface and moving the default implementations of methods to the interface is a binary compatible change, so will not affect existing clients.

With the abstract `AdminClient` marked as deprecated we can look to remove it in a future major release.

Rejected Alternatives

Rejected Alternatives

Deprecation

It was originally suggested to also deprecate the now empty `AdminClient` abstract class. However, it was felt that this would cause too much unnecessary noise for downstream users of the library, especially for uses where multiple versions of Kafka are supported, e.g. Flink, Spark, where the warnings would be unavoidable and the user can do nothing but disable themNone.