Node-RED AMQP Ack/Prefetch Nodes

1.1.2 · deprecated · verified Wed Apr 22

The `node-red-contrib-amqp-ack` package provides Node-RED users with robust input and output nodes for interacting with AMQP message brokers like RabbitMQ. Its core functionality includes subscribing to (input) and publishing to (output) AMQP exchanges or queues, with explicit support for message acknowledgment and prefetch count control, ensuring more reliable message processing within Node-RED flows. The package, currently at stable version 1.1.2, has a slow release cadence for new features, with the last significant update dating back four years. A key differentiator is its focus on reliable message delivery through configurable ack and prefetch mechanisms, which are crucial for preventing message loss or excessive load on Node-RED instances. It bundles the `amqp-ts` library for underlying AMQP connectivity, which itself is built upon `amqplib`. However, the `amqp-ts` dependency is largely unmaintained, presenting significant compatibility issues with modern Node.js versions.

Common errors

Warnings

Install

Imports

Quickstart

This Node-RED flow demonstrates basic AMQP publish/subscribe with manual acknowledgment and prefetch. It includes an AMQP input node configured with acknowledgment, a debug node to display messages, and an AMQP ack node to manually acknowledge the message after processing. An inject node triggers an AMQP output node to publish messages to a specified exchange. A shared 'amqp-server' configuration node manages the connection to the RabbitMQ broker.

[{"id":"d16f7e8a.401828","type":"tab","label":"AMQP Ack/Prefetch Example","disabled":false,"info":"Example flow demonstrating AMQP input with acknowledgment and output."},{"id":"28b1e42a.5b512","type":"amqp in","z":"d16f7e8a.401828","name":"Listen to Queue (Ack)","server":"80c32d43.6826c8","exchange":"my-exchange","queue":"my-queue","exchangeType":"topic","routingKey":"#","noAck":false,"prefetch":1,"x":160,"y":120,"wires":[["71a7d6e6.2e47e8","65c3e7b.6f23e48"]]},{"id":"71a7d6e6.2e47e8","type":"debug","z":"d16f7e8a.401828","name":"Received Message","topic":"","property":"payload","x":390,"y":120,"wires":[]},{"id":"65c3e7b.6f23e48","type":"amqp ack","z":"d16f7e8a.401828","name":"Acknowledge Message","server":"80c32d43.6826c8","x":390,"y":180,"wires":[]},{"id":"ae7d5c7b.8f3b28","type":"inject","z":"d16f7e8a.401828","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"my.key","payload":"Hello AMQP","payloadType":"str","x":140,"y":300,"wires":[["69f41b9.5a52868"]]},{"id":"69f41b9.5a52868","type":"amqp out","z":"d16f7e8a.401828","name":"Publish to Exchange","server":"80c32d43.6826c8","exchange":"my-exchange","exchangeType":"topic","routingKey":"my.key","x":390,"y":300,"wires":[]},{"id":"80c32d43.6826c8","type":"amqp-server","name":"RabbitMQ Local","host":"localhost","port":"5672","vhost":"/","clientid":"node-red","heartbeat":"60","topology":"[]","tls":""}]

view raw JSON →