Created
April 7, 2020 06:46
-
-
Save vishichoudhary/3eccbaa724f274eeb54c2c2ea08145e8 to your computer and use it in GitHub Desktop.
delete all kafka topics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
kT='/Users/vishalchoudhary/confluent-5.3.0/bin/kafka-topics' | |
TOPICS=$($kT --zookeeper localhost:2181 --list ) | |
echo $TOPICS | |
for T in $TOPICS | |
do | |
if [ "$T" != "__consumer_offsets" ]; then | |
$kT --zookeeper localhost:2181 --delete --topic $T | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment