Skip to content

mayur-shingrakhiya/RabbitMQ-With-Node-JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perfect! Here's a complete README.md content tailored for your RabbitMQ Node.js project with topic exchange, one producer, and multiple consumers:

# My RabbitMQ App

## Description
This is a **Node.js application** demonstrating a **RabbitMQ Topic Exchange** setup with **one producer** and **multiple consumers**.  
Messages are published by the producer with a routing key and consumed by the appropriate consumer(s) based on binding patterns.

---

## Features
- Topic-based message routing with RabbitMQ.
- One producer sending messages.
- Multiple consumers (WhatsApp, Email, Telegram) listening to specific routing patterns.
- Easy to extend with additional channels.

---



## Installation

1. Clone the repository:

```bash
git clone <your-repo-url>
cd my-rabbitmq-app
  1. Install dependencies:
npm install
  1. Make sure RabbitMQ is running (default amqp://localhost).

Usage

Run Producer

npm run dev:producer

Run Consumers

npm run dev:consumer:whatsapp
npm run dev:consumer:email
npm run dev:consumer:telegram

You can run multiple consumers simultaneously to see the topic exchange in action.


Exchange & Routing

  • Exchange Type: topic

  • Example Routing Keys:

    • notify.new.whatsapp
    • notify.new.email
    • notify.new.telegram

Consumers bind queues to the exchange using patterns like:

notify.*.whatsapp
notify.*.email
notify.*.telegram

Scripts

"scripts": {
  "dev": "nodemon src/server.js",
  "dev:producer": "nodemon src/producer/notifyProducer.js",
  "dev:consumer:whatsapp": "nodemon src/consumers/whatsappConsumer.js",
  "dev:consumer:email": "nodemon src/consumers/emailConsumer.js",
  "dev:consumer:telegram": "nodemon src/consumers/telegramConsumer.js"
}

Dependencies


License

MIT


---

If you want, I can also **add badges, usage examples, and a diagram showing producer → exchange → multiple consumers** to make it GitHub-ready and more professional.  

Do you want me to add that?

About

This is a Node.js application demonstrating a RabbitMQ Topic Exchange setup with one producer and multiple consumers. Messages are published by the producer with a routing key and consumed by the appropriate consumer(s) based on binding patterns.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors