--- /dev/null
+.idea
+*.iml
--- /dev/null
+[submodule "transfer"]
+ path = transfer
+ url = ../demos-kafka-payment-system-transfer
--- /dev/null
+#!/bin/bash
+
+if [ "$1" = "cleanup" ]
+then
+ docker-compose down
+ mvn clean
+ exit
+fi
+
+mvn package || exit 1
+if [ ! -e transfer/target/BUILD ] || [ "$(find transfer/target/classes/ -anewer transfer/target/BUILD | grep transfer/target/classes/de )" != "" ]
+then
+ echo "Rebuilding Docker-Image..."
+ docker-compose rm -svf transfer
+ mvn -f transfer/pom.xml docker:build
+ touch transfer/target/BUILD
+fi
+if [ "$1" = "build" ]; then exit; fi
+
+docker-compose up -d zookeeper kafka
+
+while ! [[ $(docker-compose run --rm kafka zookeeper-shell zookeeper:2181 ls /brokers/ids 2> /dev/null) =~ 1001 ]]; do echo "Waiting for kafka..."; sleep 1; done
+
+docker-compose run --rm kafka kafka-topics --zookeeper zookeeper:2181 --if-not-exists --create --replication-factor 1 --partitions 5 --topic transfers
+
+docker-compose up -d transfer
+
+docker-compose run --name transferlog --rm kafka kafka-console-consumer --bootstrap-server kafka:9093 --topic transfers &
+while ! [[ $(http 0:8091/actuator/health 2> /dev/null | jq -r .status ) =~ "UP" ]]; do echo "Waiting for transfer..."; sleep 1; done
+
+echo '{"id":1,"payer":1,"payee":2, "amount":10}' | http -v :8091/transfers
+http :8091/transfers/1
+http -v :8091/transfers id=2 payer=2 payee=1 amount=5
+http :8091/transfers/2
+
+docker container stop transferlog
--- /dev/null
+version: '3.2'
+services:
+ zookeeper:
+ image: confluentinc/cp-zookeeper:6.2.0
+ ports:
+ - "2181:2181"
+ environment:
+ ZOOKEEPER_CLIENT_PORT: 2181
+
+ kafka:
+ image: confluentinc/cp-kafka:6.2.0
+ ports:
+ - 9092:9092
+ environment:
+ KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
+ KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
+ KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092
+ KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
+ KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+ depends_on:
+ - zookeeper
+
+ transfer:
+ image: juplo/payment-service-demo--transfer:1.0.0
+ ports:
+ - "8091:8080"
+ environment:
+ juplo.transfer.bootstrap-servers: kafka:9093
+ depends_on:
+ - zookeeper
+ - kafka
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>de.trion.kafka.payment</groupId>
+ <artifactId>payment-system-setup</artifactId>
+ <name>Payment System Example - Setup</name>
+ <version>1.0.0</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>transfer</module>
+ </modules>
+
+</project>
--- /dev/null
+Subproject commit 1534808f4b16d6dae9bd0bc417852d1cc7d7191b