Buffer Payloads
This handler (com.rierino.handler.BufferEventHandler) provides ability to buffer multiple event payloads into a single batch event.
Handler Parameters
This handler requires no parameters.
Actions
Buffer
Buffers payload of the events received and releases them as a single combined event with array of input payloads in either of the following cases:
When the runner performs a commit operation (based on its settings or a commit command received)
When the number of buffered events reach buffer size provided in event parameters
Event metadata fields applicable for this action are as follows:
inputElement
Json path for payload element to buffer
parameters
-
outputElement
Json path for payload element to output buffered data
batch
-
With event metadata parameters as:
inputPattern
JMES path for transforming input element
{"id": productid}
-
outputPattern
JMES path for transforming buffered data (which is an array)
@[?id>0]
-
bufferId
Unique id for buffering similar payloads together
product_ids
-
bufferSize
Max number of records to buffer
10
-
Note that bufferSize parameter is defined at action level instead of the handler, allowing real-time changing of buffer size for different buffer types (e.g. decreasing or increasing buffer size when required without rebuilding the handler).
This handler can facilitate performance improvements for event handlers which can handle batched requests (e.g. sending update requests as a batch to write handlers or calculations to a rule event handler).
Last updated