if [ "$1" = "cleanup" ]
then
- docker-compose -f docker/docker-compose.yml down -t0 -v --remove-orphans
+ docker compose -f docker/docker-compose.yml down -t0 -v --remove-orphans
mvn clean
exit
fi
-docker-compose -f docker/docker-compose.yml up -d --remove-orphans kafka-1 kafka-2 kafka-3
-docker-compose -f docker/docker-compose.yml rm -svf producer producer-0 producer-1
+docker compose -f docker/docker-compose.yml up -d --remove-orphans kafka-1 kafka-2 kafka-3
+docker compose -f docker/docker-compose.yml rm -svf producer producer-0 producer-1
if [[
$(docker image ls -q $IMAGE) == "" ||
docker image ls $IMAGE
fi
-docker-compose -f docker/docker-compose.yml up --remove-orphans setup || exit 1
+docker compose -f docker/docker-compose.yml up --remove-orphans setup || exit 1
-docker-compose -f docker/docker-compose.yml up -t0 -d cli
+docker compose -f docker/docker-compose.yml up -t0 -d cli
sleep 1
-docker-compose -f docker/docker-compose.yml logs setup
+docker compose -f docker/docker-compose.yml logs setup
-docker-compose -f docker/docker-compose.yml up -d producer
+docker compose -f docker/docker-compose.yml up -d producer
while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done
# tag::hashed[]
kafkacat -b :9092 -t test -o 0 -p1 -f'key: %k\toffset: %o\tvalue: %s\n' -qe
echo
-docker-compose -f docker/docker-compose.yml exec -T cli bash << 'EOF'
+docker compose -f docker/docker-compose.yml exec -T cli bash << 'EOF'
echo "Altering number of partitions from 2 to 3..."
kafka-topics --bootstrap-server kafka:9092 --describe --topic test
# tag::repartitioning[]
kafka-topics --bootstrap-server kafka:9092 --describe --topic test
EOF
-docker-compose -f docker/docker-compose.yml restart producer
+docker compose -f docker/docker-compose.yml restart producer
while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done
echo -n Nachricht 4 an klaus über producer | http -v :8080/klaus
kafkacat -b :9092 -t test -o 0 -p2 -f'key: %k\toffset: %o\tvalue: %s\n' -qe
-docker-compose -f docker/docker-compose.yml restart setup
+docker compose -f docker/docker-compose.yml restart setup
sleep 1
-docker-compose -f docker/docker-compose.yml up -d producer-0 producer-1
+docker compose -f docker/docker-compose.yml up -d producer-0 producer-1
while ! [[ $(http 0:8000/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-0..."; sleep 1; done
while ! [[ $(http 0:8001/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-1..."; sleep 1; done
echo -n Nachricht 2 über producer-1 | http -v :8001/peter
# end::fixed[]
-docker-compose -f docker/docker-compose.yml exec -T cli bash << 'EOF'
+docker compose -f docker/docker-compose.yml exec -T cli bash << 'EOF'
echo "Altering number of partitions from 2 to 3..."
kafka-topics --bootstrap-server kafka:9092 --describe --topic test
kafka-topics --bootstrap-server kafka:9092 --alter --topic test --partitions 3
kafka-topics --bootstrap-server kafka:9092 --describe --topic test
EOF
-docker-compose -f docker/docker-compose.yml restart producer-0 producer-1
+docker compose -f docker/docker-compose.yml restart producer-0 producer-1
while ! [[ $(http 0:8000/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-0..."; sleep 1; done
while ! [[ $(http 0:8001/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-1..."; sleep 1; done