Skip to main content
Version: Next

Memory

The Memory buffer is an in-memory message queue that accumulates incoming message batches and releases them as a single merged batch when either a capacity threshold or a timeout is reached. It smooths out traffic spikes and provides backpressure when downstream processing cannot keep up.

Configuration

FieldTypeRequiredDefaultDescription
typestringyesmemory
capacityintegeryesMaximum number of message batches to accumulate before flushing.
timeoutdurationyesMaximum time to wait before flushing accumulated batches, even if capacity has not been reached. Examples: 1ms, 1s, 1m, 1h.

Examples

buffer:
type: "memory"
capacity: 100
timeout: "1s"
streams:
- input:
type: "generate"
context: '{ "value": 1 }'
interval: 100ms
batch_size: 1
pipeline:
thread_num: 4
processors:
- type: "json_to_arrow"
buffer:
type: "memory"
capacity: 100
timeout: "1s"
output:
type: "stdout"