Friday 1 November 2019

Kafka cli: delete a topic


Below command is used to delete a topic.
kafka-topics.sh --bootstrap-server {bootStratServerDetails} --topic {topicName} --delete

Example
kafka-topics.sh --bootstrap-server localhost:9092 --topic mySecondTopic --delete

$kafka-topics.sh --bootstrap-server localhost:9092 --list
myFirstTopic
mySecondTopic
$
$kafka-topics.sh --bootstrap-server localhost:9092 --topic mySecondTopic --delete
$
$kafka-topics.sh --bootstrap-server localhost:9092 --list
myFirstTopic


Previous                                                    Next                                                    Home

No comments:

Post a Comment