til icon indicating copy to clipboard operation
til copied to clipboard

Delete all messages from the topic

Open xluffy opened this issue 2 years ago • 0 comments

kf-config() { ./bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics $@; }
topics=($(./bin/kafka-topics.sh --list --zookeeper localhost:2181 | grep 'prefix.' | xargs))

for topic in "${topics[@]}"; do echo "Topic: ${topic} ..." && kf-config --describe --entity-name "${topic}"; done

for topic in "${topics[@]}"; do echo "Topic: ${topic} ..." && kf-config --alter --add-config retention.ms=1000 --entity-name "${topic}"; done

for topic in "${topics[@]}"; do echo "Topic: ${topic} ..." && kf-config --describe --entity-name "${topic}"; done

for topic in "${topics[@]}"; do echo "Topic: ${topic} ..." && kf-config --alter --delete-config retention.ms --entity-name "${topic}"; done

xluffy avatar Jun 03 '22 08:06 xluffy