- Tech Stack : Flask, Kafka and Socket.IO
$ First change the path in start.sh file
$ ./start.sh -u
$ ./start.sh -d
Good to go!
To add the Docker network:
- this is need for kafka broker to communicate with python servers
$ docker network rm kafka-network
- Spin up the local single-node Kafka cluster (will run in the background):
$ docker-compose -f docker-compose.yml up -d
- Check the cluster is up and running (wait for "started" to show up):
$ docker-compose -f docker-compose.yml logs -f broker | grep "started"
- Start the Python Producer and Consumer server (will run in the background):
$ docker-compose -f prod-consumer-docker/docker-compose.yml up -d
To stop the Python Producer and Consumer server:
$ docker-compose -f prod-consumer-docker/docker-compose.yml down -v
To stop the Kafka cluster:
$ docker-compose -f docker-compose.yml down -v
To remove the Docker network:
$ docker network rm kafka-network