https://github.com/madhukumargowda/nodejs-microservice-with-rabbitmq
This repository contains code for microservice implementation with a message broker (RabbitMQ) for communication between different services.
https://github.com/madhukumargowda/nodejs-microservice-with-rabbitmq
express microservice nodejs rabbitmq
Last synced: 7 months ago
JSON representation
This repository contains code for microservice implementation with a message broker (RabbitMQ) for communication between different services.
- Host: GitHub
- URL: https://github.com/madhukumargowda/nodejs-microservice-with-rabbitmq
- Owner: MadhuKumarGowda
- Created: 2025-01-20T20:58:35.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-02-24T16:38:43.000Z (8 months ago)
- Last Synced: 2025-02-24T17:43:55.104Z (8 months ago)
- Topics: express, microservice, nodejs, rabbitmq
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Node JS - Microservices with Message broker implementation
Here message broker is rabbitmqBelow steps to be repeated for publisher
1. npm init -y
2. install rabbitmq - npm i amqplib
3. Connect to the rabbitmq server
4. Create a new Channel on that connection
5. Create the exchange
6. Publish the message to the exchange with the routing keyBelow steps to be repeated for receiver
1. npm init -y
2. install rabbitmq - npm i amqplib
3. Connect to the rabbitmq server
4. Create a new Channel on that connection
5. Create the exchange
6. Create the queue
7. Bind the queue tot he exchange
8. Consume messages from the queueDownload the code, then run npm i for Publisher and Receiver
Create your own RabbitMQ instance in CloudAMQP, copy the url and replace in both publisher.js and receiver.js
then run the publisher and receiver by following commands
publisher: npm run publish
Receiver: npm run consumer