Getting started Community Training Tutorials Documentation APIs, AI & Tools
: test stream
data: first event
id: 1
data:second event
id
data: third event
MIME type: text/event-stream
ID: eventstream
DataWeave represents the Event Stream as an Array of Object, where each value is a String.
The output type is Array<{_:String}>, where each key represents a field in the event.
These examples show uses of the event stream format.
This example shows how DataWeave represents a simple server event input.
This stream contains four blocks. The first block has one comment, and fires no events. The second block has two fields with names data and id respectively; an event is fired with the data first event and sets the last event ID to 1. The third block fires an event with the data second event; it also has an id field with no value, which resets the last event ID to an empty string. The fourth block contains a data field with the value third event, which fires an event.
: test stream
data: first event
id: 1
data:second event
id
data: third event
DataWeave supports these configuration properties for this format.
This format accepts properties that provide instructions for writing output data.
| Parameter | Type | Default | Description |
|---|---|---|---|
|
|
|
Size of the buffer writer, in bytes. The value must be greater than |
|
|
|
Generates the output as a data stream when set to Valid values are |