[NEW FEATURES] node-red-contrib-queue-gate (version 1.4.0)

Node-red-contrib-queue-gate is a node for controlling message flow, including message queueing capability. This update adds three new commands, suggested and implemented by @colin. The status command refreshes the node status. This allows a flow to request the status of the gate at any time and trigger appropriate action with a status node. In particular, the initial status of the gate at startup or the number of messages in the queue can be obtained,

Two other new actions are available only in the queueing state. The peek command sends the oldest message in the queue without removing it from the queue, and drop deletes the oldest message from the queue without sending it. Together, the two commands may be used to obtain the oldest message, perform some action, and then remove the message from the queue only when it has been successfully serviced.

Also, it is no longer necessary for all control messages to be transmitted as strings. The values defining these messages are still set by the user in in the configuration dialog in the form of strings, but if the payload of a control messages is a number or boolean, the payload is converted to a string before being tested against the command definitions.

These changes are intended to be backward compatible with the previous version, so that users who do not want the new features will not need to upgrade. Please report bugs or issues here or on GitHub.

1 Like

I have added a flow to the flows library, that provides guaranteed email delivery (to the mail server) using the new peek/drop feature. It queues the email messages and if delivery fails (network failure for example) then it will wait and retry until it succeeds.
If persistent context is enabled then the queue is retained over node-red restart or power fail so queued messages will be sent following a restart. It uses the state machine node node-red-contrib-dsm for sequencing and control.



I haven't got a use case for the new feature yet but I'm sure it will come in handy one day :slight_smile:

This topic was automatically closed after 60 days. New replies are no longer allowed.