← ZIO Kafka docs

AdminClient

zio.kafka.admin.AdminClient
See theAdminClient companion object
trait AdminClient

Kafka Admin client, can be used to create, list, and delete topics, get consumer groups, etc.

This admin client is a wrapper around the java Admin client. See the API of the java admin client for a full description of the provided operations.

Typically constructed as:

 val settings: AdminClientSettings = AdminClientSettings(bootstrapServers).withCredentials(...)
 val adminClient = AdminClient.make(settings)

Unlike the java Admin client, this client waits until a write operation (e.g. creating or deleting a topic) completes. For most write operations this is done by polling the broker until we see the effect of the write operation. If after 5s the effect is still not seen, we assume the write operation succeeded but was undone by another write operation. For some operations where polling is difficult, we wait for 1s, assuming the operation completes within that time.

Attributes

Companion
object
Source
AdminClient.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

Alter offsets for the specified partitions and consumer group.

Alter offsets for the specified partitions and consumer group.

Attributes

Source
AdminClient.scala
def createAcls(acls: Set[AclBinding], options: Option[CreateAclOptions] = ...): Task[Unit]

Creates access control lists (ACLs) which are bound to specific resources.

Creates access control lists (ACLs) which are bound to specific resources.

Attributes

Source
AdminClient.scala

Creates access control lists (ACLs) which are bound to specific resources async.

Creates access control lists (ACLs) which are bound to specific resources async.

Attributes

Source
AdminClient.scala
def createPartitions(newPartitions: Map[String, NewPartitions], options: Option[CreatePartitionsOptions] = ...): Task[Unit]

Add new partitions to a topic.

Add new partitions to a topic.

Attributes

Source
AdminClient.scala
def createTopic(newTopic: NewTopic, validateOnly: Boolean = ...): Task[Unit]

Create a single topic.

Create a single topic.

Attributes

Source
AdminClient.scala
def createTopics(newTopics: Iterable[NewTopic], options: Option[CreateTopicsOptions] = ...): Task[Unit]

Create multiple topics.

Create multiple topics.

Attributes

Source
AdminClient.scala

Deletes access control lists (ACLs) according to the supplied filters.

Deletes access control lists (ACLs) according to the supplied filters.

Attributes

Source
AdminClient.scala

Deletes access control lists (ACLs) according to the supplied filters async.

Deletes access control lists (ACLs) according to the supplied filters async.

Attributes

Source
AdminClient.scala

Delete consumer groups.

Delete consumer groups.

Attributes

Source
AdminClient.scala
def deleteRecords(recordsToDelete: Map[TopicPartition, RecordsToDelete], deleteRecordsOptions: Option[DeleteRecordsOptions] = ..., visibilitySleep: Duration = ...): Task[Unit]

Delete records.

Delete records.

Value parameters

visibilitySleep

time to wait after getting a confirmation that the command was accepted by the kafka broker. This should be enough time for the operation to complete. Set to Duration.Zero if you don't care when the operation completes.

Attributes

Source
AdminClient.scala
def deleteTopic(topic: String): Task[Unit]

Delete a single topic.

Delete a single topic.

Attributes

Source
AdminClient.scala
def deleteTopics(topics: Iterable[String], options: Option[DeleteTopicsOptions] = ...): Task[Unit]

Delete multiple topics.

Delete multiple topics.

Attributes

Source
AdminClient.scala

Attributes

Source
AdminClient.scala

Get the cluster authorized operations.

Get the cluster authorized operations.

Attributes

Source
AdminClient.scala

Get the cluster controller.

Get the cluster controller.

Attributes

Source
AdminClient.scala

Get the cluster id.

Get the cluster id.

Attributes

Source
AdminClient.scala

Get the cluster nodes.

Get the cluster nodes.

Attributes

Source
AdminClient.scala

Get the configuration for the specified resources.

Get the configuration for the specified resources.

Attributes

Source
AdminClient.scala

Get the configuration for the specified resources async.

Get the configuration for the specified resources async.

Attributes

Source
AdminClient.scala

Describe the specified consumer groups.

Describe the specified consumer groups.

Attributes

Source
AdminClient.scala

Describe the specified consumer groups.

Describe the specified consumer groups.

Attributes

Source
AdminClient.scala

Describe the log directories of the specified brokers

Describe the log directories of the specified brokers

Attributes

Source
AdminClient.scala

Describe the log directories of the specified brokers async

Describe the log directories of the specified brokers async

Attributes

Source
AdminClient.scala

Describe the specified topics.

Describe the specified topics.

Attributes

Source
AdminClient.scala

Incrementally update the configuration for the specified resources. Only supported by brokers with version 2.3.0 or higher. Use alterConfigs otherwise.

Incrementally update the configuration for the specified resources. Only supported by brokers with version 2.3.0 or higher. Use alterConfigs otherwise.

When configs contains an AlterConfigOpType.Append or an AlterConfigOpType.Subtract, visibilitySleep is used. Otherwise, polling is used to wait until the operation completes.

Value parameters

visibilitySleep

time to wait after getting a confirmation that the command was accepted by the kafka broker. This should be enough time for the operation to complete. Set to Duration.Zero if you don't care when the operation completes.

Attributes

Source
AdminClient.scala

Incrementally update the configuration for the specified resources async. Only supported by brokers with version 2.3.0 or higher. Use alterConfigsAsync otherwise.

Incrementally update the configuration for the specified resources async. Only supported by brokers with version 2.3.0 or higher. Use alterConfigsAsync otherwise.

When configs contains an AlterConfigOpType.Append or an AlterConfigOpType.Subtract, visibilitySleep is used. Otherwise, polling is used to wait until the operation completes. This method still returns immediately with the outer task, sleeping/polling happens in the inner task.

Value parameters

visibilitySleep

time to wait (in the inner task) after getting a confirmation that the command was accepted by the kafka broker. This should be enough time for the operation to complete. Set to Duration.Zero if you don't care when the operation completes.

Attributes

Source
AdminClient.scala

List Consumer Group offsets for the specified partitions.

List Consumer Group offsets for the specified partitions.

Attributes

Source
AdminClient.scala

Given a mapping of consumer group IDs and list of partitions, list the consumer group offsets available in the cluster for the specified consumer groups and partitions.

Given a mapping of consumer group IDs and list of partitions, list the consumer group offsets available in the cluster for the specified consumer groups and partitions.

Attributes

Source
AdminClient.scala

Given a mapping of consumer group IDs and list of partitions, list the consumer group offsets available in the cluster for the specified consumer groups and partitions.

Given a mapping of consumer group IDs and list of partitions, list the consumer group offsets available in the cluster for the specified consumer groups and partitions.

Attributes

Source
AdminClient.scala

List the consumer groups in the cluster.

List the consumer groups in the cluster.

Attributes

Source
AdminClient.scala

List the groups in the cluster.

List the groups in the cluster.

Attributes

Source
AdminClient.scala

List offset for the specified partitions.

List offset for the specified partitions.

Attributes

Source
AdminClient.scala

List offset for the specified partitions.

List offset for the specified partitions.

Attributes

Source
AdminClient.scala
def listTopics(listTopicsOptions: Option[ListTopicsOptions] = ...): Task[Map[String, TopicListing]]

List the topics in the cluster.

List the topics in the cluster.

Attributes

Source
AdminClient.scala

Retrieves metrics for the underlying AdminClient

Retrieves metrics for the underlying AdminClient

Attributes

Source
AdminClient.scala
def removeAllMembersFromConsumerGroup(groupId: String, visibilitySleep: Duration = ...): Task[Unit]

Remove all members from a consumer group.

Remove all members from a consumer group.

Value parameters

visibilitySleep

time to wait after getting a confirmation that the command was accepted by the kafka broker. This should be enough time for the operation to complete. Set to Duration.Zero if you don't care when the operation completes.

Attributes

Source
AdminClient.scala
def removeMembersFromConsumerGroup(groupId: String, membersToRemove: Set[String], visibilitySleep: Duration = ...): Task[Unit]

Remove the specified members from a consumer group.

Remove the specified members from a consumer group.

Value parameters

visibilitySleep

time to wait after getting a confirmation that the command was accepted by the kafka broker. This should be enough time for the operation to complete. Set to Duration.Zero if you don't care when the operation completes.

Attributes

Source
AdminClient.scala

Concrete methods

Remove all members from a consumer group.

Remove all members from a consumer group.

Alias for removeAllMembersFromConsumerGroup with the default visibilitySleep.

Attributes

Source
AdminClient.scala