Package io.vertx.kafka.admin
Interface KafkaAdminClient
public interface KafkaAdminClient
Vert.x Kafka Admin client implementation
-
Method Summary
Modifier and TypeMethodDescriptionalterConfigs(Map<ConfigResource, Config> configs) LikealterConfigs(Map, Handler)but returns aFutureof the asynchronous resultvoidalterConfigs(Map<ConfigResource, Config> configs, Handler<AsyncResult<Void>> completionHandler) Update the configuration for the specified resources with the default optionsalterConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets) LikealterConsumerGroupOffsets(String, Map, Handler)but returns aFutureof the asynchronous resultvoidalterConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets, Handler<AsyncResult<Void>> completionHandler) Alter committed offsets for a set of partitions in a consumer group.close()Likeclose(Handler)but returns aFutureof the asynchronous resultclose(long timeout) Likeclose(long, Handler)but returns aFutureof the asynchronous resultvoidclose(long timeout, Handler<AsyncResult<Void>> handler) Close the admin clientvoidclose(Handler<AsyncResult<Void>> handler) 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) LikecreateAcls(List)(List, Handler)} but returns a Futureof the asynchronous resultvoidcreateAcls(List<org.apache.kafka.common.acl.AclBinding> aclBindings, Handler<AsyncResult<List<org.apache.kafka.common.acl.AclBinding>>> completionHandler) Create the ACL rules.createPartitions(Map<String, NewPartitions> partitions) LikecreatePartitions(Map, Handler)but returns aFutureof the asynchronous resultvoidcreatePartitions(Map<String, NewPartitions> partitions, Handler<AsyncResult<Void>> completionHandler) Creates a batch of new partitions in the Kafka topiccreateTopics(List<NewTopic> topics) LikecreateTopics(List, Handler)but returns aFutureof the asynchronous resultvoidcreateTopics(List<NewTopic> topics, Handler<AsyncResult<Void>> completionHandler) Creates a batch of new Kafka topicsdeleteAcls(List<org.apache.kafka.common.acl.AclBindingFilter> aclBindings) LikedeleteAcls(List)(List, Handler)} but returns a Futureof the asynchronous resultvoiddeleteAcls(List<org.apache.kafka.common.acl.AclBindingFilter> aclBindings, Handler<AsyncResult<List<org.apache.kafka.common.acl.AclBinding>>> completionHandler) Delete the ACL rules.deleteConsumerGroupOffsets(String groupId, Set<TopicPartition> partitions) LikedeleteConsumerGroupOffsets(String, Set, Handler)but returns aFutureof the asynchronous resultvoiddeleteConsumerGroupOffsets(String groupId, Set<TopicPartition> partitions, Handler<AsyncResult<Void>> completionHandler) Delete committed offsets for a set of partitions in a consumer group.deleteConsumerGroups(List<String> groupIds) LikedeleteConsumerGroups(List, Handler)but returns aFutureof the asynchronous resultvoiddeleteConsumerGroups(List<String> groupIds, Handler<AsyncResult<Void>> completionHandler) 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) LikedeleteRecords(Map, Handler)but returns aFutureof the asynchronous resultvoiddeleteRecords(Map<TopicPartition, org.apache.kafka.clients.admin.RecordsToDelete> recordsToDelete, Handler<AsyncResult<Map<TopicPartition, org.apache.kafka.clients.admin.DeletedRecords>>> completionHandler) Delete records from a topic partition.deleteTopics(List<String> topicNames) LikedeleteTopics(List, Handler)but returns aFutureof the asynchronous resultvoiddeleteTopics(List<String> topicNames, Handler<AsyncResult<Void>> completionHandler) Deletes a batch of Kafka topicsdescribeAcls(org.apache.kafka.common.acl.AclBindingFilter aclBindingFilter) LikedescribeAcls(AclBindingFilter, Handler)but returns aFutureof the asynchronous resultvoiddescribeAcls(org.apache.kafka.common.acl.AclBindingFilter aclBindingFilter, Handler<AsyncResult<List<org.apache.kafka.common.acl.AclBinding>>> completionHandler) Describe the ACL rules.LikedescribeCluster(Handler)but returns aFutureof the asynchronous resultvoiddescribeCluster(Handler<AsyncResult<ClusterDescription>> completionHandler) Describe the nodes in the cluster with the default optionsdescribeCluster(DescribeClusterOptions options) LikedescribeCluster(DescribeClusterOptions, Handler)but returns aFutureof the asynchronous resultvoiddescribeCluster(DescribeClusterOptions options, Handler<AsyncResult<ClusterDescription>> completionHandler) LikedescribeCluster(Handler)but allows customized options.describeConfigs(List<ConfigResource> configResources) LikedescribeConfigs(List, Handler)but returns aFutureof the asynchronous resultvoiddescribeConfigs(List<ConfigResource> configResources, Handler<AsyncResult<Map<ConfigResource, Config>>> completionHandler) Get the configuration for the specified resources with the default optionsdescribeConsumerGroups(List<String> groupIds) LikedescribeConsumerGroups(List, Handler)but returns aFutureof the asynchronous resultvoiddescribeConsumerGroups(List<String> groupIds, Handler<AsyncResult<Map<String, ConsumerGroupDescription>>> completionHandler) Describe some group ids in the cluster, with the default optionsdescribeConsumerGroups(List<String> groupIds, DescribeConsumerGroupsOptions options) LikedescribeConsumerGroups(List, DescribeConsumerGroupsOptions, Handler)but returns aFutureof the asynchronous resultvoiddescribeConsumerGroups(List<String> groupIds, DescribeConsumerGroupsOptions options, Handler<AsyncResult<Map<String, ConsumerGroupDescription>>> completionHandler) LikedescribeConsumerGroups(List, Handler)but allows customized optionsdescribeLogDirs(List<Integer> brokers) LikedescribeLogDirs(List, Handler)but returns aFutureof the asynchronous resultvoiddescribeLogDirs(List<Integer> brokers, Handler<AsyncResult<Map<Integer, Map<String, org.apache.kafka.clients.admin.LogDirDescription>>>> completionHandler) Query the information of all log directories on the given set of brokersdescribeTopics(List<String> topicNames) LikedescribeTopics(List, Handler)but returns aFutureof the asynchronous resultvoiddescribeTopics(List<String> topicNames, Handler<AsyncResult<Map<String, TopicDescription>>> completionHandler) Describe some topics in the cluster, with the default options.describeTopics(List<String> topicNames, DescribeTopicsOptions options) LikedescribeTopics(List, DescribeTopicsOptions, Handler)but returns aFutureof the asynchronous resultvoiddescribeTopics(List<String> topicNames, DescribeTopicsOptions options, Handler<AsyncResult<Map<String, TopicDescription>>> completionHandler) LikedescribeTopics(List, Handler)but allows for customised otionsdefault Future<Map<TopicPartition,OffsetAndMetadata>> listConsumerGroupOffsets(String groupId) LikelistConsumerGroupOffsets(String, Handler)but returns aFutureof the asynchronous resultdefault voidlistConsumerGroupOffsets(String groupId, Handler<AsyncResult<Map<TopicPartition, OffsetAndMetadata>>> completionHandler) List the consumer group offsets available in the cluster.listConsumerGroupOffsets(String groupId, ListConsumerGroupOffsetsOptions options) LikelistConsumerGroupOffsets(String, ListConsumerGroupOffsetsOptions, Handler)but returns aFutureof the asynchronous resultvoidlistConsumerGroupOffsets(String groupId, ListConsumerGroupOffsetsOptions options, Handler<AsyncResult<Map<TopicPartition, OffsetAndMetadata>>> completionHandler) List the consumer group offsets available in the cluster.LikelistConsumerGroups(Handler)but returns aFutureof the asynchronous resultvoidlistConsumerGroups(Handler<AsyncResult<List<ConsumerGroupListing>>> completionHandler) Get the the consumer groups available in the cluster with the default optionslistOffsets(Map<TopicPartition, OffsetSpec> topicPartitionOffsets) Likebut returns ainvalid @link
#listOffsets(Map<TopicPartition, OffsetSpec>, Handler)Futureof the asynchronous resultvoidlistOffsets(Map<TopicPartition, OffsetSpec> topicPartitionOffsets, Handler<AsyncResult<Map<TopicPartition, ListOffsetsResultInfo>>> completionHandler) List the offsets available for a set of partitions.LikelistTopics(Handler)but returns aFutureof the asynchronous resultvoidlistTopics(Handler<AsyncResult<Set<String>>> completionHandler) 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
List the topics available in the cluster with the default options.- Parameters:
completionHandler- handler called on operation completed with the topics set
-
listTopics
LikelistTopics(Handler)but returns aFutureof the asynchronous result -
describeTopics
void describeTopics(List<String> topicNames, Handler<AsyncResult<Map<String, TopicDescription>>> completionHandler) Describe some topics in the cluster, with the default options.- Parameters:
topicNames- the names of the topics to describecompletionHandler- handler called on operation completed with the topics descriptions
-
describeTopics
void describeTopics(List<String> topicNames, DescribeTopicsOptions options, Handler<AsyncResult<Map<String, TopicDescription>>> completionHandler) LikedescribeTopics(List, Handler)but allows for customised otions -
describeTopics
LikedescribeTopics(List, Handler)but returns aFutureof the asynchronous result -
describeTopics
Future<Map<String,TopicDescription>> describeTopics(List<String> topicNames, DescribeTopicsOptions options) LikedescribeTopics(List, DescribeTopicsOptions, Handler)but returns aFutureof the asynchronous result -
createTopics
Creates a batch of new Kafka topics- Parameters:
topics- topics to createcompletionHandler- handler called on operation completed
-
createTopics
LikecreateTopics(List, Handler)but returns aFutureof the asynchronous result -
deleteTopics
Deletes a batch of Kafka topics- Parameters:
topicNames- the names of the topics to deletecompletionHandler- handler called on operation completed
-
deleteTopics
LikedeleteTopics(List, Handler)but returns aFutureof the asynchronous result -
createPartitions
void createPartitions(Map<String, NewPartitions> partitions, Handler<AsyncResult<Void>> completionHandler) Creates a batch of new partitions in the Kafka topic- Parameters:
partitions- partitions to createcompletionHandler- handler called on operation completed
-
createPartitions
LikecreatePartitions(Map, Handler)but returns aFutureof the asynchronous result- Parameters:
partitions-
-
describeConfigs
void describeConfigs(List<ConfigResource> configResources, Handler<AsyncResult<Map<ConfigResource, Config>>> completionHandler) Get the configuration for the specified resources with the default options- Parameters:
configResources- the resources (topic and broker resource types are currently supported)completionHandler- handler called on operation completed with the configurations
-
describeConfigs
LikedescribeConfigs(List, Handler)but returns aFutureof the asynchronous 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)completionHandler- handler called on operation completed
-
alterConfigs
LikealterConfigs(Map, Handler)but returns aFutureof the asynchronous result -
listConsumerGroups
Get the the consumer groups available in the cluster with the default options- Parameters:
completionHandler- handler called on operation completed with the consumer groups ids
-
listConsumerGroups
Future<List<ConsumerGroupListing>> listConsumerGroups()LikelistConsumerGroups(Handler)but returns aFutureof the asynchronous result -
describeConsumerGroups
void describeConsumerGroups(List<String> groupIds, Handler<AsyncResult<Map<String, ConsumerGroupDescription>>> completionHandler) Describe some group ids in the cluster, with the default options- Parameters:
groupIds- the ids of the groups to describecompletionHandler- handler called on operation completed with the consumer groups descriptions
-
describeConsumerGroups
LikedescribeConsumerGroups(List, Handler)but returns aFutureof the asynchronous result -
describeConsumerGroups
void describeConsumerGroups(List<String> groupIds, DescribeConsumerGroupsOptions options, Handler<AsyncResult<Map<String, ConsumerGroupDescription>>> completionHandler) LikedescribeConsumerGroups(List, Handler)but allows customized options -
describeConsumerGroups
Future<Map<String,ConsumerGroupDescription>> describeConsumerGroups(List<String> groupIds, DescribeConsumerGroupsOptions options) LikedescribeConsumerGroups(List, DescribeConsumerGroupsOptions, Handler)but returns aFutureof the asynchronous result -
describeCluster
Describe the nodes in the cluster with the default options- Parameters:
completionHandler- handler called on operation completed with the cluster description
-
describeCluster
Future<ClusterDescription> describeCluster()LikedescribeCluster(Handler)but returns aFutureof the asynchronous result -
describeCluster
void describeCluster(DescribeClusterOptions options, Handler<AsyncResult<ClusterDescription>> completionHandler) LikedescribeCluster(Handler)but allows customized options. -
describeCluster
LikedescribeCluster(DescribeClusterOptions, Handler)but returns aFutureof the asynchronous result -
describeLogDirs
void describeLogDirs(List<Integer> brokers, Handler<AsyncResult<Map<Integer, Map<String, org.apache.kafka.clients.admin.LogDirDescription>>>> completionHandler) Query the information of all log directories on the given set of brokers- Parameters:
brokers- list of broker idscompletionHandler- aHandlercompleted with the operation result
-
describeLogDirs
Future<Map<Integer,Map<String, describeLogDirsorg.apache.kafka.clients.admin.LogDirDescription>>> (List<Integer> brokers) LikedescribeLogDirs(List, Handler)but returns aFutureof the asynchronous result -
deleteRecords
void deleteRecords(Map<TopicPartition, org.apache.kafka.clients.admin.RecordsToDelete> recordsToDelete, Handler<AsyncResult<Map<TopicPartition, org.apache.kafka.clients.admin.DeletedRecords>>> completionHandler) Delete records from a topic partition.- Parameters:
recordsToDelete- records to be delted on the given topic partitioncompletionHandler- handler called on operation completed
-
deleteRecords
Future<Map<TopicPartition,org.apache.kafka.clients.admin.DeletedRecords>> deleteRecords(Map<TopicPartition, org.apache.kafka.clients.admin.RecordsToDelete> recordsToDelete) LikedeleteRecords(Map, Handler)but returns aFutureof the asynchronous result -
deleteConsumerGroups
Delete consumer groups from the cluster.- Parameters:
groupIds- the ids of the groups to deletecompletionHandler- handler called on operation completed
-
deleteConsumerGroups
LikedeleteConsumerGroups(List, Handler)but returns aFutureof the asynchronous result -
listConsumerGroupOffsets
void listConsumerGroupOffsets(String groupId, ListConsumerGroupOffsetsOptions options, Handler<AsyncResult<Map<TopicPartition, OffsetAndMetadata>>> completionHandler) List the consumer group offsets available in the cluster.- Parameters:
groupId- The group id of the group whose offsets will be listedoptions- The options to use when listing the consumer group offsets.completionHandler- handler called on operation completed with the consumer groups offsets
-
listConsumerGroupOffsets
Future<Map<TopicPartition,OffsetAndMetadata>> listConsumerGroupOffsets(String groupId, ListConsumerGroupOffsetsOptions options) LikelistConsumerGroupOffsets(String, ListConsumerGroupOffsetsOptions, Handler)but returns aFutureof the asynchronous result -
listConsumerGroupOffsets
default void listConsumerGroupOffsets(String groupId, Handler<AsyncResult<Map<TopicPartition, OffsetAndMetadata>>> completionHandler) List the consumer group offsets available in the cluster.- Parameters:
groupId- The group id of the group whose offsets will be listedcompletionHandler- handler called on operation completed with the consumer groups offsets
-
listConsumerGroupOffsets
LikelistConsumerGroupOffsets(String, Handler)but returns aFutureof the asynchronous result -
deleteConsumerGroupOffsets
void deleteConsumerGroupOffsets(String groupId, Set<TopicPartition> partitions, Handler<AsyncResult<Void>> completionHandler) 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 deletedpartitions- The set of partitions in the consumer group whose offsets will be deleted
-
deleteConsumerGroupOffsets
LikedeleteConsumerGroupOffsets(String, Set, Handler)but returns aFutureof the asynchronous result -
alterConsumerGroupOffsets
void alterConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets, Handler<AsyncResult<Void>> completionHandler) 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
-
alterConsumerGroupOffsets
Future<Void> alterConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets) LikealterConsumerGroupOffsets(String, Map, Handler)but returns aFutureof the asynchronous result -
listOffsets
void listOffsets(Map<TopicPartition, OffsetSpec> topicPartitionOffsets, Handler<AsyncResult<Map<TopicPartition, ListOffsetsResultInfo>>> completionHandler) List the offsets available for a set of partitions.- Parameters:
topicPartitionOffsets- The options to use when listing the partition offsets.completionHandler- handler called on operation completed with the partition offsets
-
listOffsets
Future<Map<TopicPartition,ListOffsetsResultInfo>> listOffsets(Map<TopicPartition, OffsetSpec> topicPartitionOffsets) Likebut returns ainvalid @link
#listOffsets(Map<TopicPartition, OffsetSpec>, Handler)Futureof the asynchronous result -
describeAcls
void describeAcls(org.apache.kafka.common.acl.AclBindingFilter aclBindingFilter, Handler<AsyncResult<List<org.apache.kafka.common.acl.AclBinding>>> completionHandler) Describe the ACL rules.- Parameters:
aclBindingFilter- The filter to use.completionHandler- handler called on operation completed with the ACL description result.
-
describeAcls
Future<List<org.apache.kafka.common.acl.AclBinding>> describeAcls(org.apache.kafka.common.acl.AclBindingFilter aclBindingFilter) LikedescribeAcls(AclBindingFilter, Handler)but returns aFutureof the asynchronous result -
createAcls
void createAcls(List<org.apache.kafka.common.acl.AclBinding> aclBindings, Handler<AsyncResult<List<org.apache.kafka.common.acl.AclBinding>>> completionHandler) Create the ACL rules.- Parameters:
aclBindings- The ACL to create.completionHandler- handler called on operation completed with the ACL creation result.
-
createAcls
Future<List<org.apache.kafka.common.acl.AclBinding>> createAcls(List<org.apache.kafka.common.acl.AclBinding> aclBindings) LikecreateAcls(List)(List, Handler)} but returns a Futureof the asynchronous result -
deleteAcls
void deleteAcls(List<org.apache.kafka.common.acl.AclBindingFilter> aclBindings, Handler<AsyncResult<List<org.apache.kafka.common.acl.AclBinding>>> completionHandler) Delete the ACL rules.- Parameters:
aclBindings- The filter to delete matching ACLs.completionHandler- handler called on operation completed with the ACL deletion result.
-
deleteAcls
Future<List<org.apache.kafka.common.acl.AclBinding>> deleteAcls(List<org.apache.kafka.common.acl.AclBindingFilter> aclBindings) LikedeleteAcls(List)(List, Handler)} but returns a Futureof the asynchronous result -
close
Close the admin client- Parameters:
handler- aHandlercompleted with the operation result
-
close
Likeclose(Handler)but returns aFutureof the asynchronous result -
close
Close the admin client- Parameters:
timeout- timeout to wait for closinghandler- aHandlercompleted with the operation result
-
close
Likeclose(long, Handler)but returns aFutureof the asynchronous result
-