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 and includes features like delayed processing and auto-flushing. This node is useful in scenarios where message batching, delayed processing, or queue management is needed, such as accumulating events before processing or managing task queues.
Use Case Examples
- Push messages to a named stack for later processing.
- Pop a specified number of messages from the stack to process them.
- Peek at messages without removing them to inspect the queue state.
- Flush all messages after a delay to batch process accumulated data.
Properties
| Name | Meaning |
|---|---|
| Stack Name | The name of the stack to operate on, allowing multiple independent stacks. |
Output
JSON
success- Indicates if the operation was successful.operation- The operation performed on the stack.stackName- The name of the stack involved in the operation.messagesPushed- Number of messages pushed to the stack (for push operations).totalMessages- Total number of messages currently in the stack.delaySeconds- Delay time in seconds for delay-related operations.autoFlush- Indicates if auto flush is enabled after delay.willFlushAt- Timestamp when the stack will auto flush.messages- Array of messages returned from the stack.count- Count of messages returned.messagesPopped- Number of messages popped from the stack.messagesPeeked- Number of messages peeked at in the stack.messagesFlushed- Number of messages flushed from the stack.size- Current size of the stack.lastActivity- Timestamp of the last activity on the stack.hasPendingTimeout- Indicates if there is a pending timeout for delayed processing.messagesCleared- Number of messages cleared from the stack.message- Informational message about the stack state, e.g., empty stack.actualWaitTimeSeconds- Actual wait time elapsed during delay operations.
Troubleshooting
- Ensure the stack name is provided and consistent to avoid operating on unintended stacks.
- If using delay operations, verify that the delaySeconds parameter is set correctly to avoid unexpected timing behavior.
- When popping or peeking messages, setting maxMessages to 0 returns all messages; ensure this is intended to avoid large data processing.
- If the stack is empty, operations like pop, peek, or flush will return an empty result with a success message indicating the stack is empty.