This is a small sample tutorial to show the produce cconsumer architecture of Apache Kafka and how it can be implemented in a modular nodejs(express js) project for a well defined microservice coding paradigm
WorkFlow When the curl request is sent, the publisher publishes an event to Kafka. All consumers who have subscribed are then notfied by Kafka and they react according to the parsed logic.
Cloning the app
- npm install kafkajs express
Running the application
- docker-compose up -d
- npm run test
Curl request sample
curl -X POST http://localhost:4000/users
-H "Content-Type: application/json"
-d '{"name":"Alice","email":"alice@example.com"}'