See: Description
Interface | Description |
---|---|
AdminUtils |
Provides a wrapper around important methods in Kafka's AdminUtils, namely
|
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()
----Copyright © 2018 Eclipse. All rights reserved.