simple rabbitmq-nodejs to connect to amqp and to send/receive messages
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
.
There are multiple ways to do that:
- A - As node.js app
- git clone https://github.com/hovig/rabbitmq-nodejs.git
- npm install
- npm start
- B - As a docker
- docker pull hovig/rabbitmq-nodejs
- docker run hovig/rabbitmq-nodejs
- C - As a docker on your local machine
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: