Compose
![]()
Description
The Compose processor merges two event streams by combining their properties. It supports:
- Real-time event stream merging
- Last-event state tracking
- Custom output field selection
- Dynamic event composition
- Stateful event processing
This processor is essential for:
- Combining data from multiple sources
- Creating unified event views
- Merging related event streams
- Building composite event structures
Required Input
The processor requires two input streams:
- First stream: Any event stream with at least one property
- Second stream: Any event stream with at least one property
Configuration
Output Selection
During pipeline modeling, you can select which fields from each stream should be included in the output event. The processor will:
- Keep the last event from each stream in memory
- Merge selected fields when new events arrive
- Forward the combined event with selected fields
Output
The processor creates a new event containing the selected fields from both input streams. The output is generated whenever:
- A new event arrives from either stream
- The last event from the other stream is available
Example
Input Event Stream 1
{
"deviceId": "sensor01",
"temperature": 25.5,
"timestamp": 1586380104915
}
Input Event Stream 2
{
"location": "room1",
"humidity": 45.2,
"timestamp": 1586380104915
}
Configuration
- Output Fields: deviceId, temperature, location, humidity
Output Event
{
"deviceId": "sensor01",
"temperature": 25.5,
"location": "room1",
"humidity": 45.2
}
Use Cases
-
Data Integration
- Combine sensor readings
- Merge related metrics
- Create unified views
- Join event streams
-
Event Enrichment
- Add context to events
- Combine related data
- Create composite events
- Build rich event structures
Notes
- Events are merged in real-time
- Last event state is maintained
- Output fields are configurable
- Original event structure is preserved
- Events are forwarded on any new input
- State is cleared on pipeline stop