Simple flow to connect listen to messages published in RabbitMQ

Uses the node-red-contrib-amqp node to listen to messages published to a queue in RabbitMQ and display it in debug output

Install node-red https://nodered.org/docs/getting-started/installation
Install node-red-contrib-amqp https://www.npmjs.com/package/node-red-contrib-amqp
Install RabbitMQ https://www.rabbitmq.com/download.html

Run rabbitmq-server
Login to web UI using username 'guest' and password 'guest'
Create new queue test-queue

Publish messages to this queue from terminal by
./rabbitmqadmin publish exchange=amq.default routing_key=test-queue payload="hello, world"

See messages in node-red debug window

[{"id":"5fafbb51.1fd9b4","type":"tab","label":"Flow 1"},{"id":"6b1cb95.2baed48","type":"inject","z":"5fafbb51.1fd9b4","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":156.5,"y":141,"wires":[["e1a95443.665058"]]},{"id":"e1a95443.665058","type":"debug","z":"5fafbb51.1fd9b4","name":"","active":true,"console":"false","complete":"false","x":433.5,"y":143,"wires":[]},{"id":"456ecdae.887d84","type":"amqp in","z":"5fafbb51.1fd9b4","name":"","topic":"","iotype":"4","ioname":"test-queue","server":"f9ec9a1a.ccac58","x":137.5,"y":255,"wires":[["e1a95443.665058"]]},{"id":"f9ec9a1a.ccac58","type":"amqp-server","z":"","host":"localhost","port":"5672","vhost":"","keepalive":"30","usetls":false,"verifyservercert":true,"usetopology":false,"topology":"{\n\t\"exchanges\": [\n\t\t{\"name\": \"exchange1\", \"type\": \"direct\", \"options\": {\"durable\": false}},\n\t\t{\"name\": \"exchange2\"}\n\t],\n\t\"queues\": [\n\t\t{\"name\": \"queue1\", \"options\": {\"messageTtl\": 60000}},\n\t\t{\"name\": \"queue2\"}\n\t],\n\t\"bindings\": [\n\t\t{\"source\": \"exchange1\", \"queue\": \"queue1\", \"pattern\": \"debug\", \"args\": {}},\n\t\t{\"source\": \"exchange1\", \"exchange\": \"exchange2\", \"pattern\": \"error\"},\n\t\t{\"source\": \"exchange2\", \"queue\": \"queue2\"}\n\t]\n}"}]

Flow Info

Created 6 years, 11 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • debug (x1)
  • inject (x1)
Other
  • amqp in (x1)
  • amqp-server (x1)
  • tab (x1)

Tags

  • amqp
  • rabbitmq
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option