Skip to content

Latest commit

 

History

History
executable file
·
40 lines (26 loc) · 1.19 KB

README.md

File metadata and controls

executable file
·
40 lines (26 loc) · 1.19 KB

rabbitmq-nodejs

simple rabbitmq-nodejs to connect to amqp and to send/receive messages

rabbitmq architecture explained

A node.js based dockerized application that connects to amqp and serves as an api to pass/send a message through publish api and puts it in the queue under a queue name that the subscribe api receives it.

Make sure rabbitmq-server is downloaded. Run rabbitmq-server start.

To run the application:

There are multiple ways to do that:

  • A - As node.js app
  1. git clone https://github.com/hovig/rabbitmq-nodejs.git
  2. npm install
  3. npm start
  • B - As a docker
  1. docker pull hovig/rabbitmq-nodejs
  2. docker run hovig/rabbitmq-nodejs
  • C - As a docker on your local machine

What to expect when you run the messaging broker:

To send a message and push it to the queue:

http://localhost:5000/publish/{"fitcoins":10, "steps":20}

To receive message from the queue:

http://localhost:5000/subscribe

Output: