Table of Contents |
---|
Status
Current state: DraftDiscarded
Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]
...
Currently the BrokerApiVersionsCommand
tool uses its own custom admin client to send ApiVersions requests to broker. This is the last tool that relies on code from the old AdminClient.scala
class. This tool is useful to identify what Kafka version a broker is running and which features it supports. For example, since 2.3, alterConfig has been deprecated and users should use incrementalAlterConfig instead. However there is no way to find if a broker supports this new API. Users have to attempt an incrementalAlterConfig call and if an UnsupportedOperationException is raised, fallback to AlterConfigalterConfig. Being able to get the supported ApiVersions per broker would simplify building robust client applications.
...
Code Block | ||
---|---|---|
| ||
default DescribeApiVersionsResultListApiVersionsResult describeApiVersionslistApiVersions(Collection<Node> brokers) { return describeApiVersionslistApiVersions(brokers, new DescribeApiVersionsOptionsListApiVersionsOptions()); } DescribeApiVersionsResultListApiVersionsResult describeApiVersionslistApiVersions(Collection<Node> brokers, DescribeApiVersionsOptionsListApiVersionsOptions options); |
With the following companion objects:
DescribeApiVersionsOptionsListApiVersionsOptions.java:
Code Block | ||
---|---|---|
| ||
public class DescribeApiVersionsOptionsListApiVersionsOptions extends AbstractOptions<DescribeApiVersionsOptions>AbstractOptions<ListApiVersionsOptions> { } |
DescribeApiVersionsResultListApiVersionsResult.java:
Code Block | ||
---|---|---|
| ||
public class DescribeApiVersionsResultListApiVersionsResult { public DescribeApiVersionsResultListApiVersionsResult(Map<Node, KafkaFutureImpl<NodeApiVersions>> futures) {} public Map<Node, KafkaFutureImpl<NodeApiVersions>> values() {} /** * Return a future which succeeds only if all the config descriptions succeed. */ public KafkaFuture<Map<Node, KafkaFutureImpl<NodeApiVersions>>> all() {} } |
...
- Add 2 new methods to the AdminClient API: describeApiVersionslistApiVersions(Collection) and describeApiVersionslistApiVersions(Collection, DescribeApiVersionsOptionsListApiVersionsOptions)
- Add companion objects: DescribeApiVersionsOptionsListApiVersionsOptions, DescribeApiVersionsResultListApiVersionsResult
- Move existing NodeApiVersions class to org.apache.kafka.clients.admin
- Update BrokerApiVersionsCommand to use the new AdminClient methods
...