node-red-contrib-message-queues 1.0.4
## Overview This Node-RED custom node provides a message queue. It allows users to add messages to a queue and process them one at a time.
Node-RED Custom Node: Message Queue
Overview
This Node-RED custom node provides a message queue. It allows users to add messages to a queue and process them one at a time.
Features
- Message Queue Management: Add and consume messages with a structured queue.
- Simple API: Easily interact with the queue using predefined message types.
Installation
Clone the repository or download the source code.
Navigate to your Node-RED user directory (usually
~/.node-red
).Run the following command to install the node:
npm install node-red-contrib-message-queues
Restart Node-RED.
Usage
Input Messages
The node processes input messages with the following structure:
Add a Message to the Queue:
{ "type": "add", "payload": "message ID" }
type
: Indicates the operation to perform (add
).payload
: The unique ID of the message to add to the queue.
Consume the Current Message:
{ "type": "consume", "payload": "message ID" }
type
: Indicates the operation to perform (consume
).payload
: The unique ID of the message currently being processed. Only the active message can be consumed.
Node Configuration
- Drag and drop the custom node into your Node-RED flow.
- Configure any optional settings in the node properties.
- Connect the node to other nodes for input and output processing.
Example Workflow
- Add Messages: Send multiple
add
messages to populate the queue. - Process Messages: Use the
consume
message to process the current message. Upon successful processing, the next message in the queue will be activated.
Example Screenshot
Output
- Outputs the current message being processed.
- Emits errors or status updates in case of invalid operations.