Skip to main content
Version: Next

Batch

The Batch processor accumulates incoming message batches and flushes them as a single merged batch when either a configured message count is reached or a timeout elapses. It is useful for grouping small batches together to improve downstream throughput.

Configuration

FieldTypeRequiredDefaultDescription
typestringyesbatch
countintegeryesNumber of message batches to accumulate before flushing.
timeout_msintegeryesMaximum time in milliseconds to wait before flushing an incomplete batch.

Examples

- processor:
type: "batch"
count: 1000
timeout_ms: 1000
streams:
- input:
type: "memory"
messages:
- '{ "value": 1 }'
- '{ "value": 2 }'
pipeline:
thread_num: 4
processors:
- type: "batch"
count: 100
timeout_ms: 500
output:
type: "stdout"