Skip to content

Commit 2f8587b

Browse files
committed
Improve local setup 4
1 parent 52f9cb2 commit 2f8587b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22

3+
/opt/kafka/bin/kafka-topics.sh --list --zookeeper zookeeper:2181 > exists-topics.txt
34
while read topic; do
4-
/opt/kafka/bin/kafka-topics.sh --create --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic $topic
5-
done < topics.txt
5+
/opt/kafka/bin/kafka-topics.sh --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic $topic
6+
done < <(sort topics.txt exists-topics.txt exists-topics.txt | uniq -u)

0 commit comments

Comments
 (0)