https://github.com/tamdilip/kafka-nodejs-docker
Simple Kafka hello world example with docker and nodejs.
https://github.com/tamdilip/kafka-nodejs-docker
docker docker-compose kafka kafka-consumer kafka-docker kafka-node kafka-producer nodejs
Last synced: about 2 months ago
JSON representation
Simple Kafka hello world example with docker and nodejs.
- Host: GitHub
- URL: https://github.com/tamdilip/kafka-nodejs-docker
- Owner: tamdilip
- Created: 2021-06-12T15:43:05.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-12T16:20:00.000Z (almost 4 years ago)
- Last Synced: 2025-02-12T10:43:38.364Z (3 months ago)
- Topics: docker, docker-compose, kafka, kafka-consumer, kafka-docker, kafka-node, kafka-producer, nodejs
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📣 kafka-nodejs-docker
Simple Kafka sample to boot up zookeeper and kafka service with docker and nodejs scripts to create a topic, a consumer listening to the topic and a producer to publish message with specified partion to a topic.### Boot Zookeeper and Kafka
Initial Docker compose up to create image and run container.
```sh
$ docker-compose up -d
```
Secondary docker commands to start/stop containers.
```sh
$ docker-compose stop
$ docker-compose start
```
### Kafka Node scripts* `node create-topic.js` - creates a kafka topic with specified number of partitions.
* `node consumer.js` - subscribes/listens to kafka topic for published/incoming messages.
* `node producer.js message_one 1` - publishes message to a kafka topic to the specified partition.
### References
- https://www.baeldung.com/ops/kafka-docker-setup
- https://www.youtube.com/watch?v=R873BlNVUB4**Happy coding :) !!**