/rabbitmq-nodejs-poc

Basic RabbitMQ integration with Node.js using amqplib.

Primary LanguageJavaScript

RabbitMQ with Node.js POC

Basic RabbitMQ integration with Node.js using amqplib.

Required Dependencies

  • Docker
  • Docker Compose

Usage

  1. Clone this project and install its dependencies with yarn or npm:
yarn 

-- or --

npm install
  1. Start the local RabbitMQ instance with Docker Compose in the root folder where the docker-compose.yml file is located:
sudo docker-compose up
  1. Open http://localhost:15672 on your browser, then you should see the RabbitMQ UI

  2. Type guest for both the username and password

  3. Now open a terminal window and start the consumer script, located in the src directory, that will listen to the messages in the RabbitMQ Queue:

node consumer.js
  1. Finally, start the producer script on another terminal window that will send the messages to the queue:
node producer.js
  1. You should be able to see the received messages on the consumer terminal window and also the incoming activity on the RabbitMQ admin panel running on the browser.