This project creates 1 broker with a topic named Users.
There are 2 partitions:
- Names between A-M go in partition 1
- Names between N-Z go in partition 2
docker-compose -f docker-compose.yml up -d
This script creates a topic named "Users"
node topics.js
This script produces events to topic "Users"
node producer.js <message>
This script creates a consumer and continues running and subscribes to the Users topic.
node consumer.js
Can be ran again to create another consumer.
Notice how the two consumers each read from one partition now.
List topics
docker exec -it kafka /bin/kafka-topics --list --bootstrap-server localhost:9092