Overview
This node manages a message stack (or queue) allowing users to store, retrieve, and manipulate messages with various operations such as push, pop, peek, flush, size, and clear. It supports multiple independent stacks identified by a stack name. The node is useful for scenarios where message buffering, delayed processing, or batch handling is needed, such as accumulating messages before processing or retrieving a subset of messages from a queue.
Use Case Examples
- Push messages to a named stack to accumulate data for batch processing.
- Pop a specified number of messages from the stack to process them individually or as an array.
- Peek at messages in the stack without removing them to inspect current queued data.
- Flush all messages from the stack to retrieve and clear the queue at once.
Properties
| Name | Meaning |
|---|---|
| Stack Name | The name of the stack to operate on, allowing multiple independent stacks. |
| Max Messages | Maximum number of messages to return when popping or peeking (0 means return all). |
| Return Format | How to return the messages: either as individual items or as a single array. |
Output
JSON
success- Indicates if the operation was successful.operation- The operation performed (e.g., pop, push, flush).stackName- The name of the stack operated on.messagesPushed- Number of messages pushed to the stack (for push operations).totalMessages- Total number of messages currently in the stack.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.messagesCleared- Number of messages cleared from the stack.messages- Array of messages returned from the stack (for pop, peek, flush operations).count- Count of messages returned in the current operation.message- Informational message about the operation result, e.g., if the stack was empty.size- Current size of the stack (number of messages).lastActivity- Timestamp of the last activity on the stack.hasPendingTimeout- Indicates if there is a pending timeout for delayed processing.delaySeconds- Delay time in seconds used in delayed push operations.autoFlush- Indicates if auto flush is enabled after delay in delayed push operations.willFlushAt- Timestamp when the stack will auto flush after delay.actualWaitTimeSeconds- Actual wait time elapsed during push-wait-flush operation.
Troubleshooting
- If the specified operation is not supported, the node throws an error indicating the unsupported operation. Ensure the operation parameter is set correctly.
- If the stack is empty when popping, peeking, or flushing, the node returns a success message with zero messages and an informational message indicating the stack is empty.
- For delayed push operations, if the delay or auto flush parameters are misconfigured, messages may not flush as expected. Verify delaySeconds and autoFlush settings.