Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@alameenkh7
Last active March 18, 2018 11:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alameenkh7/c9cc8cf6f4b493ec6ae3d8b97e9fd0e5 to your computer and use it in GitHub Desktop.
Save alameenkh7/c9cc8cf6f4b493ec6ae3d8b97e9fd0e5 to your computer and use it in GitHub Desktop.
Sample flow to send and recieve message from a rabbitmq server

Uses the node-red-contrib-amqp node to send and 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

start the rabbitmq server.

if you click on the inject node you can see that message is being sent to rabbitmq and listen to the rabbitmq and shows in the debug window.

You can send any type of data in the inject node by adjusting the input please note that the queue name in both input and output node must be same.

[{"id":"a2c0fe79.167fe8","type":"amqp in","z":"31021ae3.1b765e","name":"","topic":"","iotype":"4","ioname":"new_test","server":"1dde2dd.ec1ec52","x":137.5,"y":255,"wires":[["88eed72c.68c1f"]]},{"id":"1dde2dd.ec1ec52","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}"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment