Setup für die Übung "linger-ms"
authorKai Moritz <kai@juplo.de>
Sun, 3 Apr 2022 10:55:58 +0000 (12:55 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 3 Apr 2022 14:52:46 +0000 (16:52 +0200)
README.sh
docker-compose.yml

index f651155..20ccf79 100755 (executable)
--- a/README.sh
+++ b/README.sh
@@ -25,9 +25,39 @@ fi
 echo "Waiting for the Kafka-Cluster to become ready..."
 docker-compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1
 docker-compose up setup
-docker-compose up -d
+docker-compose up -d producer
 
-sleep 15
+sleep 10
+echo "Sennding message to :8080/foo..."
+time echo foo | http -v :8080/foo
 
+docker-compose up -d
 
-docker-compose stop producer consumer
+sleep 1
+echo "Sennding message to :8080/foo..."
+time echo foo | http -v :8080/foo
+sleep 1
+echo "Sennding message to :8080/foo..."
+time echo foo | http -v :8080/foo
+sleep 1
+echo "Sennding message to :8080/foo..."
+time echo foo | http -v :8080/foo
+sleep 1
+echo "Sennding message to :8080/foo..."
+time echo foo | http -v :8080/foo
+sleep 1
+echo "Sennding message to :8080/foo..."
+time echo foo | http -v :8080/foo
+sleep 1
+echo "Sennding message to :8080/foo..."
+time echo foo | http -v :8080/foo
+sleep 1
+echo "Sennding message to :8080/foo..."
+time echo foo | http -v :8080/foo
+sleep 1
+echo "Sennding message to :8080/foo..."
+time echo foo | http -v :8080/foo
+
+http -v :8000/seen
+
+docker-compose stop
index 336c459..28a8a7b 100644 (file)
@@ -29,7 +29,7 @@ services:
     command: >
       bash -c "
         kafka-topics --bootstrap-server kafka:9092 --delete --if-exists --topic test
-        kafka-topics --bootstrap-server kafka:9092 --create --topic test --partitions 2
+        kafka-topics --bootstrap-server kafka:9092 --create --topic test --partitions 1
       "
 
   cli:
@@ -44,11 +44,63 @@ services:
       producer.bootstrap-server: kafka:9092
       producer.client-id: producer
       producer.topic: test
+      producer.batch-size: 16384
+      producer.linger-ms: 5000
+
+  peter:
+    image: juplo/rest-client:1.0-SNAPSHOT
+    ports:
+      - 8081:8080
+    environment:
+      server.port: 8080
+      rest-client.baseUrl: http://producer:8080
+      rest-client.username: peter
+      rest-client.throttle-ms: 1
+
+  klaus:
+    image: juplo/rest-client:1.0-SNAPSHOT
+    ports:
+      - 8082:8080
+    environment:
+      server.port: 8080
+      rest-client.baseUrl: http://producer:8080
+      rest-client.username: klaus
+      rest-client.throttle-ms: 1
+
+  beate:
+    image: juplo/rest-client:1.0-SNAPSHOT
+    ports:
+      - 8083:8080
+    environment:
+      server.port: 8080
+      rest-client.baseUrl: http://producer:8080
+      rest-client.username: beate
+      rest-client.throttle-ms: 1
+
+  franz:
+    image: juplo/rest-client:1.0-SNAPSHOT
+    ports:
+      - 8084:8080
+    environment:
+      server.port: 8080
+      rest-client.baseUrl: http://producer:8080
+      rest-client.username: franz
+      rest-client.throttle-ms: 1
+
+  uschi:
+    image: juplo/rest-client:1.0-SNAPSHOT
+    ports:
+      - 8085:8080
+    environment:
+      server.port: 8080
+      rest-client.baseUrl: http://producer:8080
+      rest-client.username: uschi
+      rest-client.throttle-ms: 1
 
   consumer:
     image: juplo/counting-consumer:1.0-SNAPSHOT
     ports:
-      - 8081:8081
+      - 8000:8081
     environment:
       consumer.bootstrap-server: kafka:9092
       consumer.client-id: my-group