Skip to content

Horizontal scaling of WebSockets using KAFKA, FLASK, and SOCKET.IO

Notifications You must be signed in to change notification settings

yashwanthrk/Flask-SokcetIO-Kafka-DockerCompose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Kafka Python

Horizontal scaling of websockets using KAFKA

  • Tech Stack : Flask, Kafka and Socket.IO
$ First change the path in start.sh file

To start the Kafka and Python server

$ ./start.sh -u

To stop the Kafka and Python server

$ ./start.sh -d

Good to go!

Optional (Not neccessary) - For educatiional purpose :p

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

Stopping

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

About

Horizontal scaling of WebSockets using KAFKA, FLASK, and SOCKET.IO

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published