Overview
This node manages a message stack (or queue) allowing users to store, retrieve, and manipulate messages with various operations such as pushing, popping, peeking, flushing, and clearing messages. It supports multiple independent stacks identified by a stack name. The node is useful for scenarios where message accumulation, delayed processing, or batch handling of messages is needed, such as buffering data before processing or managing task queues.
Use Case Examples
- Push messages to a named stack to accumulate data for batch processing.
- Pop a specified number of messages from the stack for processing.
- Peek at messages without removing them to inspect the current queue state.
- Flush all messages to retrieve and clear the stack at once, useful for batch operations or cleanup.
Properties
| Name | Meaning |
|---|---|
| Stack Name | The name of the stack to operate on, allowing multiple independent stacks to be managed separately. |
Output
JSON
success- Indicates if the operation was successfuloperation- The operation performed on the stackstackName- The name of the stack involved in the operationmessagesPushed- Number of messages added to the stack (for push operations)totalMessages- Total number of messages currently in the stackdelaySeconds- Delay time in seconds used for delayed push operationsautoFlush- Indicates if auto flush is enabled after delaywillFlushAt- Timestamp when the stack will auto flushmessagesReturned- Number of messages returned from the stackmessagesPopped- Number of messages removed from the stackmessagesPeeked- Number of messages viewed without removalmessagesFlushed- Number of messages flushed from the stacksize- Current number of messages in the stacklastActivity- Timestamp of the last activity on the stackhasPendingTimeout- Indicates if there is a pending timeout for delayed processingmessagesCleared- Number of messages cleared from the stackmessages- Array of messages returned in batch operationscount- Count of messages returned in batch operationsmessage- Informational message about the stack state, e.g., empty stack
Troubleshooting
- Ensure the stack name is provided and consistent to avoid operating on unintended stacks.
- If using delayed push operations, verify that the delay and auto flush settings are correctly configured to prevent messages from being stuck in the stack.
- When popping or peeking messages, check the maxMessages parameter to avoid unexpected empty results.
- If the node throws an error about unsupported operations, verify that the operation parameter is set to one of the supported values: push, pop, peek, flush, size, clear, pushWithDelay, or pushWaitFlush.