Project is made using Typescript (Subsequent JS files also included for reference).
This is producer project and if you haven't cloned the consumer project for RabbitMQ. follow the How does this work instructions.
- Clone this Producer Repository by running
git clone https://github.com/manojselvin/message-queue-producer
- Clone Consumer Repository by running
git clone https://github.com/manojselvin/message-queue-worker
- Run Both the projects by following the steps mentioned to run the project in each projects
README.md
file.
- Clone this project by running
git clone https://github.com/manojselvin/message-queue-producer
cd
intoproject dir
- Complete
Steps to generate Connection URL for RabbitMQ
. - run
npm install
to install all dependencies - run
npm start
to run the producer server. - Now use
postman
to post data to the routePOST /msg
{
"queueName": "<Queue name from config/config.json>",
"payload": "<Any message in the form of string or json to be pushed into the queue>"
}
Note: (Skip if already followed this on Consumer Project setup)
- Go to https://www.cloudamqp.com/plans.html
- Select
free plan
. - Sign up for a
free account
. - Create a new instance in the
regions
listed. - Create a
new queue
and note down thename of the queue
. Click on the instance
and fromside navigation
click on Details
thencopy
theAMQP URL
.- Paste the connection url and queue name in
config/config.json
file.