Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.13 KB

File metadata and controls

39 lines (29 loc) · 1.13 KB

Node-Express-RabbitMQ

Basic use of RabbitMQ queue manager in NodeJS

Installation

Requirements

  • Docker
  • Node
  • Npm

Download and install

$ git clone https://github.com/Dev-Wito/Node-Express-RabbitMQ.git 
$ cd Node-Express-RabbitMQ
$ npm install

Run server

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

Usage

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

Rabbit MQ Interface

http://127.0.0.1:15672/ User admin and password El Profesor Super O