Source: YouTube Video
docker-compose -f docker-compose.yml up -d
docker ps
docker exec -it kafka /bin/sh
cd opt/kafka_2.13-2.8.1/bin
kafka-topics.sh --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 1 --topic messages
pip install kafka-python
Open a PyCharm terminal.
python producer.py
Open a different PyCharm terminal.
python consumer.py
docker-compose down
Video link: YouTube
docker-compose -f docker-compose.yml up -d
docker ps
docker exec -it kafka /bin/sh
cd opt/kafka_2.13-2.8.1/bin
kafka-topics.sh --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 2 --topic registered_user_2
Open a PyCharm terminal.
python producer_2.py
python consumer_2.py
(open in two terminals)