This node provides multiple, independently controlled message queues. Each queue has the capabilities of the queueing mode of the q-gate node, with some additional features. The design goals were:
Flexible queue structure
The user does not need to define in advance how many queues are required or how they are identified.
Economy of memory
Queues are created as needed on a "per topic" basis and destroyed when empty. (Messages are routed using msg.topic
by default, but any other message property can be used.) The size of each queue can be limited, and its behavior when full can be defined.
Complete command set
Each queue is controlled using the command set of the queueing
mode of the q-gate
node: trigger
, status
,flush
, peek
, drop
, and reset
. In addition, commands are provided to allow each individual queue to be paused or to resume queueing and to modify the settings that control its size limit and behavior when full or empty. Any of these commands can also be addressed to all queues simultaneously.
Flexible command set
None of the control message properties or payloads is "hard-wired" in the code. The edit dialog allows the user to define the message property and payload used for each command.
Enhanced status reporting
An option is provided to create a second output that delivers a status object containing the requested message queue and all the queue-specific settings.
Persistence
An option allows the queues and node settings to be restored from a non-volatile context store, if available, after a system or Node-RED restart.
Thanks to @nileio for suggesting this project. Please report bugs or leave suggestions here or on GitHub.