Submodules pipeline build status:
Message producer provides api (see Swagger)
- Clone the project with submodules using following command
git clone --recurse-submodules [email protected]:rednavis/kafka-spring-boot-demo.git
- Run these commands to create a network and run Kafka and Zookeeper in docker containers.
docker network create kafka
docker run -d --net=kafka --name=zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 confluentinc/cp-zookeeper:5.0.0
docker run -d --net=kafka --name=kafka -p 9092:9092 -e KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 confluentinc/cp-kafka:5.0.0
- If you can’t connect, add this line to
/etc/hosts
to ensure proper routing to container network “kafka”
127.0.0.1 kafka
- Start messaging platforms with docker start command
docker start zookeeper
docker start kafka
- Start submodules by calling
./mvnw spring-boot:run
in each module.
After starting message-producer you can find Swagger UI page at localhost:57300/demo/api/swagger-ui.html