Fastify Microservice Setup with Apache Kafka
This git is part for a blog NodeJS Microservice with Fastify and Kafka
Assuming Apache Kafka is running on your local.
Step 1: Run API Gateway
cd api
npm i
cp .env.example .env
npm run dev
Step 2: Run Microservice 1
cd ms1
npm i
cp .env.example .env
npm run dev
Step 2: Run Microservice 2
cd ms2
npm i
cp .env.example .env
npm run dev
Now open below urls and check console for logs.
http://127.0.0.1:5000/produce?topic=common (message consumed in api,ms1,ms2)
http://127.0.0.1:5000/produce?topic=api (message consumed in api)
http://127.0.0.1:5000/produce?topic=ms1 (message consumed in ms1)
http://127.0.0.1:5000/produce?topic=ms2 (message consumed in ms2)