From d163a1185383114eff55fdc2a434eff9d2762cdd Mon Sep 17 00:00:00 2001 From: Yuriy Novikov Date: Wed, 23 Aug 2017 15:58:24 +0000 Subject: [PATCH] ALLOW DELETE TOPICS --- kafka/scripts/start-kafka.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kafka/scripts/start-kafka.sh b/kafka/scripts/start-kafka.sh index 168fc97..5531b4f 100755 --- a/kafka/scripts/start-kafka.sh +++ b/kafka/scripts/start-kafka.sh @@ -1,6 +1,7 @@ #!/bin/sh # Optional ENV variables: +# * ALLOW_DELETE_TOPICS: adds delete.topic.enable=true to server.properties # * ADVERTISED_HOST: the external ip for the container, e.g. `docker-machine ip \`docker-machine active\`` # * ADVERTISED_PORT: the external port for Kafka, e.g. 9092 # * ZK_CHROOT: the zookeeper chroot that's used by Kafka (without / prefix), e.g. "kafka" @@ -71,5 +72,13 @@ if [ ! -z "$AUTO_CREATE_TOPICS" ]; then echo "auto.create.topics.enable=$AUTO_CREATE_TOPICS" >> $KAFKA_HOME/config/server.properties fi +# Enable/disable topics deletion +if [ ! -z "$ALLOW_DELETE_TOPICS" ]; then + echo "delete.topic.enable: $ALLOW_DELETE_TOPICS" + echo "delete.topic.enable=$ALLOW_DELETE_TOPICS" >> $KAFKA_HOME/config/server.properties +fi + + + # Run Kafka $KAFKA_HOME/bin/kafka-server-start.sh $KAFKA_HOME/config/server.properties