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.mdfile.
- Clone this project by running
git clone https://github.com/manojselvin/message-queue-producer cdintoproject dir- Complete
Steps to generate Connection URL for RabbitMQ. - run
npm installto install all dependencies - run
npm startto run the producer server. - Now use
postmanto 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
regionslisted. - Create a
new queueand note down thename of the queue. Click on the instanceand fromside navigationclick on DetailsthencopytheAMQP URL.- Paste the connection url and queue name in
config/config.jsonfile.