Skip to content

raviroshanmehta/kafka-ms-fastify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kafka-ms-fastify

Fastify Microservice Setup with Apache Kafka

This git is part for a blog NodeJS Microservice with Fastify and Kafka

How to run

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

Usage

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)

About

Fastify Microservice Setup with Apache Kafka

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published