: test stream
data: first event
id: 1
data:second event
id
data: third event
Event Stream Format
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.
Examples
These examples show uses of the Event Stream format.
Example: Simple Server Event Input
This example shows how DataWeave represents a simple server event input.
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.
Configuration Properties
DataWeave supports these configuration properties for this format.
Writer Properties
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 |