Interface KafkaAdminClient
public interface KafkaAdminClient
Vert.x Kafka Admin client implementation
-
Method Summary
Modifier and TypeMethodDescriptionalterConfigs(Map<ConfigResource, Config> configs) Update the configuration for the specified resources with the default optionsalterConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets) Alter committed offsets for a set of partitions in a consumer group.close()Close the admin clientclose(long timeout) Close the admin clientstatic KafkaAdminClientCreate a new KafkaAdminClient instancestatic KafkaAdminClientcreate(Vertx vertx, Properties config) Create a new KafkaAdminClient instancestatic KafkaAdminClientCreate a new KafkaAdminClient instancecreateAcls(List<org.apache.kafka.common.acl.AclBinding> aclBindings) Create the ACL rules.createPartitions(Map<String, NewPartitions> partitions) Creates a batch of new partitions in the Kafka topiccreateTopics(List<NewTopic> topics) Creates a batch of new Kafka topicsdeleteAcls(List<org.apache.kafka.common.acl.AclBindingFilter> aclBindings) Delete the ACL rules.deleteConsumerGroupOffsets(String groupId, Set<TopicPartition> partitions) Delete committed offsets for a set of partitions in a consumer group.deleteConsumerGroups(List<String> groupIds) Delete consumer groups from the cluster.Future<Map<TopicPartition, org.apache.kafka.clients.admin.DeletedRecords>> deleteRecords(Map<TopicPartition, org.apache.kafka.clients.admin.RecordsToDelete> recordsToDelete) Delete records from a topic partition.deleteTopics(List<String> topicNames) Deletes a batch of Kafka topicsdescribeAcls(org.apache.kafka.common.acl.AclBindingFilter aclBindingFilter) Describe the ACL rules.Describe the nodes in the cluster with the default optionsdescribeCluster(DescribeClusterOptions options) LikedescribeCluster()but allows customized options.describeConfigs(List<ConfigResource> configResources) Get the configuration for the specified resources with the default optionsdescribeConsumerGroups(List<String> groupIds) Describe some group ids in the cluster, with the default optionsdescribeConsumerGroups(List<String> groupIds, DescribeConsumerGroupsOptions options) LikedescribeConsumerGroups(List)but allows customized optionsdescribeLogDirs(List<Integer> brokers) Query the information of all log directories on the given set of brokersdescribeTopics(List<String> topicNames) Describe some topics in the cluster, with the default options.describeTopics(List<String> topicNames, DescribeTopicsOptions options) LikedescribeTopics(List)but allows for customised otionsdefault Future<Map<TopicPartition, OffsetAndMetadata>> listConsumerGroupOffsets(String groupId) List the consumer group offsets available in the cluster.listConsumerGroupOffsets(String groupId, ListConsumerGroupOffsetsSpec spec, ListConsumerGroupOffsetsOptions options) List the consumer group offsets available in the cluster.Get the the consumer groups available in the cluster with the default optionslistOffsets(Map<TopicPartition, OffsetSpec> topicPartitionOffsets) List the offsets available for a set of partitions.List the topics available in the cluster with the default options.
-
Method Details
-
create
Create a new KafkaAdminClient instance- Parameters:
vertx- Vert.x instance to useadminClient- Kafka native Admin client instance- Returns:
- an instance of the KafkaAdminClient
-
create
Create a new KafkaAdminClient instance- Parameters:
vertx- Vert.x instance to useconfig- Kafka admin client configuration- Returns:
- an instance of the KafkaAdminClient
-
create
Create a new KafkaAdminClient instance- Parameters:
vertx- Vert.x instance to useconfig- Kafka admin client configuration- Returns:
- an instance of the KafkaAdminClient
-
listTopics
-
describeTopics
-
describeTopics
Future<Map<String, TopicDescription>> describeTopics(List<String> topicNames, DescribeTopicsOptions options) LikedescribeTopics(List)but allows for customised otions -
createTopics
-
deleteTopics
-
createPartitions
Creates a batch of new partitions in the Kafka topic- Parameters:
partitions- partitions to create- Returns:
- a future notified with the result
-
describeConfigs
Get the configuration for the specified resources with the default options- Parameters:
configResources- the resources (topic and broker resource types are currently supported)- Returns:
- a future notified with the result
-
alterConfigs
Update the configuration for the specified resources with the default options- Parameters:
configs- The resources with their configs (topic is the only resource type with configs that can be updated currently)- Returns:
- a future notified with the result
-
listConsumerGroups
Future<List<ConsumerGroupListing>> listConsumerGroups()Get the the consumer groups available in the cluster with the default options- Returns:
- a future notified with the result
-
describeConsumerGroups
-
describeConsumerGroups
Future<Map<String, ConsumerGroupDescription>> describeConsumerGroups(List<String> groupIds, DescribeConsumerGroupsOptions options) LikedescribeConsumerGroups(List)but allows customized options -
describeCluster
Future<ClusterDescription> describeCluster()Describe the nodes in the cluster with the default options- Returns:
- a future notified with the result
-
describeCluster
LikedescribeCluster()but allows customized options. -
describeLogDirs
-
deleteRecords
Future<Map<TopicPartition, org.apache.kafka.clients.admin.DeletedRecords>> deleteRecords(Map<TopicPartition, org.apache.kafka.clients.admin.RecordsToDelete> recordsToDelete) Delete records from a topic partition.- Parameters:
recordsToDelete- records to be delted on the given topic partition- Returns:
- a future notified with the result
-
deleteConsumerGroups
-
listConsumerGroupOffsets
Future<Map<TopicPartition, OffsetAndMetadata>> listConsumerGroupOffsets(String groupId, ListConsumerGroupOffsetsSpec spec, ListConsumerGroupOffsetsOptions options) List the consumer group offsets available in the cluster.- Parameters:
groupId- The group id of the group whose offsets will be listedspec- The spec to use when listing the consumer group offsets.options- The options to use when listing the consumer group offsets.- Returns:
- a future notified with the result
-
listConsumerGroupOffsets
List the consumer group offsets available in the cluster.- Parameters:
groupId- The group id of the group whose offsets will be listed- Returns:
- a future notified with the result
-
deleteConsumerGroupOffsets
Delete committed offsets for a set of partitions in a consumer group. This will succeed at the partition level only if the group is not actively subscribed to the corresponding topic.- Parameters:
groupId- The group id of the group whose offsets will be deleted- Returns:
- a future notified with the result
-
alterConsumerGroupOffsets
Future<Void> alterConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets) Alter committed offsets for a set of partitions in a consumer group.- Parameters:
groupId- The group id of the group whose offsets will be alteredoffsets- The map of offsets in the consumer group which will be altered- Returns:
- a future notified with the result
-
listOffsets
Future<Map<TopicPartition, ListOffsetsResultInfo>> listOffsets(Map<TopicPartition, OffsetSpec> topicPartitionOffsets) List the offsets available for a set of partitions.- Parameters:
topicPartitionOffsets- The options to use when listing the partition offsets.- Returns:
- a future notified with the result
-
describeAcls
-
createAcls
-
deleteAcls
-
close
-
close
-