4 docker compose -f scram-docker-compose.yml up -d
6 until [ "$(docker inspect -f {{.State.Running}} broker)" == "true" ]; do
10 echo -e "\n Creating kafka users"
11 docker exec broker kafka-configs --zookeeper zookeeper:2181 --alter --add-config 'SCRAM-SHA-256=[password=broker],SCRAM-SHA-512=[password=broker]' --entity-type users --entity-name broker
12 docker exec broker kafka-configs --zookeeper zookeeper:2181 --alter --add-config 'SCRAM-SHA-256=[password=client-secret],SCRAM-SHA-512=[password=client-secret]' --entity-type users --entity-name client
14 echo -e "\n Creating test topic"
15 docker exec broker kafka-topics --create --bootstrap-server broker:9092 --replication-factor 1 --partitions 1 --topic test-topic.1 --command-config config.properties
17 echo -e "\n Listing existing topics"
18 docker exec broker kafka-topics --list --bootstrap-server localhost:9092 --command-config config.properties
20 echo -e "\n Adding broker to /etc/hosts"
21 echo '127.0.0.1 broker' | sudo tee -a /etc/hosts
27 docker compose -f scram-docker-compose.yml down
29 sudo sed -i.bak '/broker/d' /etc/hosts
33 docker exec -it broker kafka-console-producer --bootstrap-server localhost:9092 --topic test-topic.1 --producer.config config.properties
38 Usage: ./runner.sh [start|stop]