Package io.vertx.kafka.admin
Interface KafkaAdminClient
-
public interface KafkaAdminClient
Vert.x Kafka Admin client implementation
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Future<Void>
alterConfigs(Map<ConfigResource,Config> configs)
Update the configuration for the specified resources with the default optionsFuture<Void>
alterConsumerGroupOffsets(String groupId, Map<TopicPartition,OffsetAndMetadata> offsets)
Alter committed offsets for a set of partitions in a consumer group.Future<Void>
close()
Close the admin clientFuture<Void>
close(long timeout)
Close the admin clientstatic KafkaAdminClient
create(Vertx vertx, Map<String,String> config)
Create a new KafkaAdminClient instancestatic KafkaAdminClient
create(Vertx vertx, Properties config)
Create a new KafkaAdminClient instancestatic KafkaAdminClient
create(Vertx vertx, org.apache.kafka.clients.admin.AdminClient adminClient)
Create a new KafkaAdminClient instanceFuture<List<org.apache.kafka.common.acl.AclBinding>>
createAcls(List<org.apache.kafka.common.acl.AclBinding> aclBindings)
Create the ACL rules.Future<Void>
createPartitions(Map<String,NewPartitions> partitions)
Creates a batch of new partitions in the Kafka topicFuture<Void>
createTopics(List<NewTopic> topics)
Creates a batch of new Kafka topicsFuture<List<org.apache.kafka.common.acl.AclBinding>>
deleteAcls(List<org.apache.kafka.common.acl.AclBindingFilter> aclBindings)
Delete the ACL rules.Future<Void>
deleteConsumerGroupOffsets(String groupId, Set<TopicPartition> partitions)
Delete committed offsets for a set of partitions in a consumer group.Future<Void>
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.Future<Void>
deleteTopics(List<String> topicNames)
Deletes a batch of Kafka topicsFuture<List<org.apache.kafka.common.acl.AclBinding>>
describeAcls(org.apache.kafka.common.acl.AclBindingFilter aclBindingFilter)
Describe the ACL rules.Future<ClusterDescription>
describeCluster()
Describe the nodes in the cluster with the default optionsFuture<ClusterDescription>
describeCluster(DescribeClusterOptions options)
LikedescribeCluster()
but allows customized options.Future<Map<ConfigResource,Config>>
describeConfigs(List<ConfigResource> configResources)
Get the configuration for the specified resources with the default optionsFuture<Map<String,ConsumerGroupDescription>>
describeConsumerGroups(List<String> groupIds)
Describe some group ids in the cluster, with the default optionsFuture<Map<String,ConsumerGroupDescription>>
describeConsumerGroups(List<String> groupIds, DescribeConsumerGroupsOptions options)
LikedescribeConsumerGroups(List)
but allows customized optionsFuture<Map<Integer,Map<String,org.apache.kafka.clients.admin.LogDirDescription>>>
describeLogDirs(List<Integer> brokers)
Query the information of all log directories on the given set of brokersFuture<Map<String,TopicDescription>>
describeTopics(List<String> topicNames)
Describe some topics in the cluster, with the default options.Future<Map<String,TopicDescription>>
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.Future<Map<TopicPartition,OffsetAndMetadata>>
listConsumerGroupOffsets(String groupId, ListConsumerGroupOffsetsOptions options)
List the consumer group offsets available in the cluster.Future<List<ConsumerGroupListing>>
listConsumerGroups()
Get the the consumer groups available in the cluster with the default optionsFuture<Map<TopicPartition,ListOffsetsResultInfo>>
listOffsets(Map<TopicPartition,OffsetSpec> topicPartitionOffsets)
List the offsets available for a set of partitions.Future<Set<String>>
listTopics()
List the topics available in the cluster with the default options.
-
-
-
Method Detail
-
create
static KafkaAdminClient create(Vertx vertx, org.apache.kafka.clients.admin.AdminClient adminClient)
Create a new KafkaAdminClient instance- Parameters:
vertx
- Vert.x instance to useadminClient
- Kafka native Admin client instance- Returns:
- an instance of the KafkaAdminClient
-
create
static KafkaAdminClient create(Vertx vertx, Map<String,String> config)
Create a new KafkaAdminClient instance- Parameters:
vertx
- Vert.x instance to useconfig
- Kafka admin client configuration- Returns:
- an instance of the KafkaAdminClient
-
create
static KafkaAdminClient create(Vertx vertx, Properties config)
Create a new KafkaAdminClient instance- Parameters:
vertx
- Vert.x instance to useconfig
- Kafka admin client configuration- Returns:
- an instance of the KafkaAdminClient
-
listTopics
Future<Set<String>> listTopics()
List the topics available in the cluster with the default options.- Returns:
- a future notified with the result
-
describeTopics
Future<Map<String,TopicDescription>> describeTopics(List<String> topicNames)
Describe some topics in the cluster, with the default options.- Parameters:
topicNames
- the names of the topics to describe- Returns:
- a future notified with the result
-
describeTopics
Future<Map<String,TopicDescription>> describeTopics(List<String> topicNames, DescribeTopicsOptions options)
LikedescribeTopics(List)
but allows for customised otions
-
createTopics
Future<Void> createTopics(List<NewTopic> topics)
Creates a batch of new Kafka topics- Parameters:
topics
- topics to create- Returns:
- a future notified with the result
-
deleteTopics
Future<Void> deleteTopics(List<String> topicNames)
Deletes a batch of Kafka topics- Parameters:
topicNames
- the names of the topics to delete- Returns:
- a future notified with the result
-
createPartitions
Future<Void> createPartitions(Map<String,NewPartitions> partitions)
Creates a batch of new partitions in the Kafka topic- Parameters:
partitions
- partitions to create- Returns:
- a future notified with the result
-
describeConfigs
Future<Map<ConfigResource,Config>> describeConfigs(List<ConfigResource> configResources)
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
Future<Void> alterConfigs(Map<ConfigResource,Config> configs)
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
Future<Map<String,ConsumerGroupDescription>> describeConsumerGroups(List<String> groupIds)
Describe some group ids in the cluster, with the default options- Parameters:
groupIds
- the ids of the groups to describe- Returns:
- a future notified with the result
-
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
Future<ClusterDescription> describeCluster(DescribeClusterOptions options)
LikedescribeCluster()
but allows customized options.
-
describeLogDirs
Future<Map<Integer,Map<String,org.apache.kafka.clients.admin.LogDirDescription>>> describeLogDirs(List<Integer> brokers)
Query the information of all log directories on the given set of brokers- Parameters:
brokers
- list of broker ids- Returns:
- a future notified with the result
-
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
Future<Void> deleteConsumerGroups(List<String> groupIds)
Delete consumer groups from the cluster.- Parameters:
groupIds
- the ids of the groups to delete- Returns:
- a future notified with the result
-
listConsumerGroupOffsets
Future<Map<TopicPartition,OffsetAndMetadata>> listConsumerGroupOffsets(String groupId, ListConsumerGroupOffsetsOptions options)
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.- Returns:
- a future notified with the result
-
listConsumerGroupOffsets
default Future<Map<TopicPartition,OffsetAndMetadata>> listConsumerGroupOffsets(String groupId)
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
Future<Void> deleteConsumerGroupOffsets(String groupId, Set<TopicPartition> partitions)
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
Future<List<org.apache.kafka.common.acl.AclBinding>> describeAcls(org.apache.kafka.common.acl.AclBindingFilter aclBindingFilter)
Describe the ACL rules.- Parameters:
aclBindingFilter
- The filter to use.- Returns:
- a future notified with the result
-
createAcls
Future<List<org.apache.kafka.common.acl.AclBinding>> createAcls(List<org.apache.kafka.common.acl.AclBinding> aclBindings)
Create the ACL rules.- Parameters:
aclBindings
- The ACL to create.- Returns:
- a future notified with the result
-
deleteAcls
Future<List<org.apache.kafka.common.acl.AclBinding>> deleteAcls(List<org.apache.kafka.common.acl.AclBindingFilter> aclBindings)
Delete the ACL rules.- Parameters:
aclBindings
- The filter to delete matching ACLs.- Returns:
- a future notified with the result
-
-