This is consumer project and if you haven't cloned the producer project for RabbitMQ. follow the How does this work ? instructions below.
- Clone Producer Repository by running
git clone https://github.com/manojselvin/message-queue-producer - Clone this Consumer Repository
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-worker cdintoproject dir- Complete
Steps to generate Connection URL for RabbitMQ. - run
npm installto install all dependencies - run
npm startto run the consumer to start listening for new messages into to queue. - If any new message in sent in the queue then it will be logged into the console log.
Note: (Skip if already followed this on Producer 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.