{"id":16865,"library":"node-red-contrib-amqp-ack","title":"Node-RED AMQP Ack/Prefetch Nodes","description":"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.","status":"deprecated","version":"1.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/elgranloky/node-red-contrib-amqp-ack","tags":["javascript","node-red","amqp","rabbitmq","amqp-ts"],"install":[{"cmd":"npm install node-red-contrib-amqp-ack","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-contrib-amqp-ack","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-contrib-amqp-ack","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for Node-RED runtime environment to load and use the nodes.","package":"node-red","optional":false},{"reason":"Core library for AMQP connectivity, though it is unmaintained and causes compatibility issues with modern Node.js.","package":"amqp-ts","optional":false}],"imports":[{"note":"These are internal Node-RED registrations, typically found within the node's `.js` definition files. End-users interact with nodes by dragging them from the Node-RED editor palette. Direct ESM/CJS imports in user-land JavaScript are not how these Node-RED contrib nodes are typically consumed.","wrong":"import { AmqpInNode } from 'node-red-contrib-amqp-ack';","symbol":"Node-RED Node Registration","correct":"RED.nodes.registerType('amqp in', AmqpInNode);\nRED.nodes.registerType('amqp out', AmqpOutNode);\nRED.nodes.registerType('amqp ack', AmqpAckNode);\nRED.nodes.registerType('amqp-server', AmqpServerConfigNode);"},{"note":"This CommonJS `require` pattern is how Node-RED's runtime loads individual node definition files, typically from within the package's directory. ESM imports are not supported for these internal Node-RED node files.","wrong":"import AmqpInNode from 'node-red-contrib-amqp-ack/nodes/amqp-in';","symbol":"Loading Node Definitions (Internal Node-RED)","correct":"const AmqpInNode = require('./nodes/amqp-in.js');\nconst AmqpOutNode = require('./nodes/amqp-out.js');\nconst AmqpAckNode = require('./nodes/amqp-ack.js');\nconst AmqpServerConfigNode = require('./nodes/amqp-server.js');"}],"quickstart":{"code":"[{\"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\":\"\"}]","lang":"json","description":"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."},"warnings":[{"fix":"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.","message":"The underlying `amqp-ts` library is unmaintained and is anchored to `amqplib@0.4.2`, which only supports Node.js versions up to 8. This package is incompatible with modern Node.js runtimes (Node.js 10+).","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"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`.","message":"This package is explicitly recommended to be replaced by alternative AMQP Node-RED contributions for environments using modern Node.js versions due to its core dependency's outdated status.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Always double-check AMQP server credentials. Monitor Node-RED logs for connection errors. Ensure the RabbitMQ server is accessible and configured correctly.","message":"Entering invalid credentials (username/password) in the AMQP configuration node can lead to Node-RED malfunctioning or becoming unresponsive, as the connection attempts might consume excessive resources.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"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.","message":"When `noAck` is unchecked on the 'amqp in' node, messages are not automatically acknowledged. Failure to use an 'amqp ack' node downstream will leave messages unacknowledged in the queue, leading to redelivery upon connection loss or message processing timeout.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"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).","cause":"The underlying `amqp-ts` library uses an old version of `amqplib` which is incompatible with newer Node.js versions or has module resolution issues in certain environments.","error":"Failed to load flow: Error: Cannot find module 'amqplib/lib/connection'."},{"fix":"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.","cause":"The connection to the AMQP broker (e.g., RabbitMQ) was unexpectedly closed, often due to network instability, broker restart, or incorrect broker configuration.","error":"Error: read ECONNRESET / Connection closed. No error event. / Amqp rabbit disconnected issue."},{"fix":"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.","cause":"The 'amqp in' node is configured with 'noAck' unchecked, but no 'amqp ack' node is present in the flow to acknowledge messages after processing, leading to the broker re-queueing them.","error":"Messages are received by the 'amqp in' node but disappear without being processed by subsequent nodes, or are re-delivered repeatedly."}],"ecosystem":"npm","meta_description":null}