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.
npm install node-red-contrib-amqp-ackVerified import paths — ran on the pinned version, not inferred.
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.
It is strongly recommended to migrate to an alternative Node-RED AMQP package, such as `@meowwolf/node-red-contrib-amqp`, for compatibility with current Node.js versions. If migration is not an option, ensure your Node-RED instance runs on Node.js 8 or older, which is not recommended for security or performance.
Consider uninstalling this package and installing `@meowwolf/node-red-contrib-amqp` via the Node-RED Palette Manager or npm: `npm install @meowwolf/node-red-contrib-amqp`.
Always double-check AMQP server credentials. Monitor Node-RED logs for connection errors. Ensure the RabbitMQ server is accessible and configured correctly.
For reliable processing, always follow an 'amqp in' node with `noAck` unchecked by an 'amqp ack' node once message processing is complete. Implement error handling to ensure `nack` or `reject` is used for failed messages.
Upgrade your Node-RED instance to use a different AMQP package like `@meowwolf/node-red-contrib-amqp` which supports modern Node.js. If you must use this package, downgrade your Node.js runtime to version 8 or older (not recommended).
Verify network connectivity between Node-RED and the AMQP broker. Check RabbitMQ server logs for client disconnect reasons. Ensure the AMQP server configuration node has correct hostname, port, and vhost settings. While the node attempts reconnection, persistent issues require external resolution.
Ensure that every 'amqp in' node configured for explicit acknowledgment (`noAck` unchecked) has a corresponding 'amqp ack' node in its processing path to confirm message consumption. Place the 'amqp ack' node after all processing steps have successfully completed.