Administrative functions for Kafka - topic management, cluster info, etc.
Administrative functions for Kafka - topic management, cluster info, etc.
(close! admin-client)
Close the AdminClient and release resources.
Close the AdminClient and release resources.
(create-admin-client config)
Create a Kafka AdminClient with the given configuration.
Example config: {:bootstrap-servers "localhost:9092"}
Create a Kafka AdminClient with the given configuration. Example config: {:bootstrap-servers "localhost:9092"}
(create-topic! admin-client topic-name)
(create-topic! admin-client
topic-name
{:keys [partitions replication-factor configs]
:or {partitions 1 replication-factor 1 configs {}}})
Create a new Kafka topic.
Options: :partitions - number of partitions (default: 1) :replication-factor - replication factor (default: 1) :configs - map of topic configurations
Usage: (create-topic! admin-client "my-topic") (create-topic! admin-client "my-topic" {:partitions 3 :replication-factor 2}) (create-topic! admin-client "my-topic" {:partitions 3 :configs {"cleanup.policy" "compact"}})
Create a new Kafka topic. Options: :partitions - number of partitions (default: 1) :replication-factor - replication factor (default: 1) :configs - map of topic configurations Usage: (create-topic! admin-client "my-topic") (create-topic! admin-client "my-topic" {:partitions 3 :replication-factor 2}) (create-topic! admin-client "my-topic" {:partitions 3 :configs {"cleanup.policy" "compact"}})
(create-topic-if-not-exists! admin-client topic-name)
(create-topic-if-not-exists! admin-client topic-name options)
Create a topic only if it doesn't already exist.
Usage: (create-topic-if-not-exists! admin-client "my-topic" {:partitions 3})
Create a topic only if it doesn't already exist. Usage: (create-topic-if-not-exists! admin-client "my-topic" {:partitions 3})
(delete-topic! admin-client topic-name)
Delete a Kafka topic.
Usage: (delete-topic! admin-client "my-topic")
Delete a Kafka topic. Usage: (delete-topic! admin-client "my-topic")
(describe-topic admin-client topic-name)
Get detailed information about a topic.
Usage: (describe-topic admin-client "my-topic")
Get detailed information about a topic. Usage: (describe-topic admin-client "my-topic")
(get-cluster-info admin-client)
Get basic information about the Kafka cluster.
Usage: (get-cluster-info admin-client)
Get basic information about the Kafka cluster. Usage: (get-cluster-info admin-client)
(list-topics admin-client)
List all topics in the Kafka cluster. Returns a set of topic names.
Usage: (list-topics admin-client)
List all topics in the Kafka cluster. Returns a set of topic names. Usage: (list-topics admin-client)
(topic-exists? admin-client topic-name)
Check if a topic exists.
Usage: (topic-exists? admin-client "my-topic")
Check if a topic exists. Usage: (topic-exists? admin-client "my-topic")
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |