Basic use of RabbitMQ queue manager in NodeJS
- Docker
- Node
- Npm
$ git clone https://github.com/Dev-Wito/Node-Express-RabbitMQ.git
$ cd Node-Express-RabbitMQ
$ npm install
The npm start
command, by default, starts a Rabbit MQ worker
$ npm start
If you want to start more Workers that execute the messages of the queue you must use the command npm run worker
$ npm run worker
A queue manager allows us to alleviate the loads of our servers, in processes that can be asynchronous, such as generating PDFs or sending emails; Useful for those processes that are quite demanding in consumption of resources.
In this example you can start an instance of a REST service and many workers that listen to a Mailerman
queue, in which you could do any task you want and raise as many workers as you wish to lighten the server load.
Import Postman Collection.json
to your postman so you can test the exercise in detail
http://127.0.0.1:15672/
User admin
and password El Profesor Super O