Skip navigation links

Package io.vertx.kafka.admin

= Vert.x Kafka AdminUtils :toc: left :lang: $lang :$lang: $lang This component provides a vert.x wrapper around the most important functions of Kafka's AdminUtils.

See: Description

Package io.vertx.kafka.admin Description

= Vert.x Kafka AdminUtils :toc: left :lang: $lang :$lang: $lang This component provides a vert.x wrapper around the most important functions of Kafka's AdminUtils. AdminUtils are used to create, modify, and delete topics. Other functionality covered by AdminUtils, but not this wrapper, includes Partition Management, Broker Configuration management, etc. == Using the AdminUtils === Create a topic You can call AdminUtils.createTopic(java.lang.String, int, int, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) to create a topic. Parameters are: topic name, number of partitions, number of replicas, and the usual callback to handle the result. It might return an error, e.g. if the number of requested replicas is greater than the number of brokers. [source,$lang] ---- examples.AdminUtilsExamples#createTopic ---- === Delete a topic You can call AdminUtils.deleteTopic(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) to delete a topic. Parameters are: topic name, and the usual callback to handle the result. It might return an error, e.g. if the topic does not exist. [source,$lang] ---- examples.AdminUtilsExamples#deleteTopic ---- === Change a topic's configuration If you need to update the configuration of a topic, e.g., you want to update the retention policy, you can call AdminUtils.changeTopicConfig(java.lang.String, java.util.Map<java.lang.String, java.lang.String>, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) to update a topic. Parameters are: topic name, a Map (String -> String) with parameters to be changed, and the usual callback to handle the result. It might return an error, e.g. if the topic does not exist. [source,$lang] ---- examples.AdminUtilsExamples#changeTopicConfig()} ---- === Check if a topic exists If you want to check if a topic exists, you can call AdminUtils.topicExists(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Boolean>>). Parameters are: topic name, and the usual callback to handle the result. It might return an error, e.g. if the topic does not exist. [source,$lang] ---- examples.AdminUtilsExamples#topicExists() ----
Skip navigation links

Copyright © 2018 Eclipse. All rights reserved.