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.md
file.
- Clone this project by running
git clone https://github.com/manojselvin/message-queue-worker
cd
intoproject dir
- Complete
Steps to generate Connection URL for RabbitMQ
. - run
npm install
to install all dependencies - run
npm start
to 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
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.