streams - Übungen - Microservices - Schritt 01
[demos/microservices] / README.sh
index 2b528ce..6c3eba1 100755 (executable)
--- a/README.sh
+++ b/README.sh
@@ -7,6 +7,8 @@ then
   exit
 fi
 
+trap 'kill $(jobs -p)' EXIT
+
 mvn package
 
 docker build -t trion/take-order-service:0 take-order
@@ -18,3 +20,11 @@ while ! [[ $(zookeeper-shell zookeeper:2181 ls /brokers/ids 2> /dev/null) =~ 100
 kafka-topics --zookeeper zookeeper:2181 --if-not-exists --create --replication-factor 1 --partitions 5 --topic orders
 
 docker-compose up -d take-order
+
+kafka-avro-console-consumer --bootstrap-server kafka:9092 --topic orders &
+sleep 10 # TODO: Warum ist /health nicht erreichbar?!?
+http -v post 0:8091/orders Accept:*/* id=1 customerId=2 productId=234 quantity=5
+http -v post 0:8091/orders Accept:*/* id=1 customerId=2 productId=234 quantity=
+http -v post 0:8091/orders Accept:*/* id=1 customerId=2 productId=234 quantity=-5
+http -v post 0:8091/orders Accept:*/* id=1 customerId=2 productId=-234 quantiyt=5
+http -v post 0:8091/orders Accept:*/* customerId=2 productId=234 quantity=5