new AdminUtils()
Provides a wrapper around important methods in Kafka's AdminUtils, namely
Methods
changeTopicConfig(topicName, topicConfig, completionHandler)
Updates the configuration of the topic given by topicName. Configuration parameters
are passed in as a Map (Key -> Value) of Strings.
Parameters:
Name | Type | Description |
---|---|---|
topicName |
string | topic to be configured |
topicConfig |
Array.<string> | Map with configuration items |
completionHandler |
function | vert.x callback |
close(completionHandler)
Closes the underlying connection to Zookeeper. It is required to call the method for cleanup
purposes if AdminUtils was not created with autoClose set to true.
Parameters:
Name | Type | Description |
---|---|---|
completionHandler |
function | vert.x callback |
createTopic(topicName, partitionCount, replicationFactor, topicConfig, completionHandler)
Creates a new Kafka topic on all Brokers managed by the given Zookeeper instance(s). In contrast
to @see AdminUtils#createTopic, one can pass in additional configuration
parameters as a map (String -> String).
Parameters:
Name | Type | Description |
---|---|---|
topicName |
string | Name of the to-be-created topic |
partitionCount |
number | Number of partitions |
replicationFactor |
number | Number of replicates. Must be lower or equal to the number of available Brokers |
topicConfig |
Array.<string> | map with additional topic configuration parameters |
completionHandler |
function | vert.x callback |
deleteTopic(topicName, completionHandler)
Delete the Kafka topic given by the topicName.
Parameters:
Name | Type | Description |
---|---|---|
topicName |
string | Name of the topic to be deleted |
completionHandler |
function | vert.x callback |
topicExists(topicName, completionHandler)
Checks if the Kafka topic given by topicName does exist.
Parameters:
Name | Type | Description |
---|---|---|
topicName |
string | Name of the topic |
completionHandler |
function | vert.x callback |