liveBook · Manning

Compose agent

As explained in Event Processing in Action

A transformation agent that combines two input event streams by matching event instances and deriving output events from matching pairs.

A compose agent is a stateful transformation event processing agent that joins two input event streams. It matches events from the left stream with events from the right stream and derives an output event from each matching pair. The operation resembles a relational join, but joins streams rather than tables. section 8.2.4 section 2.3.4

A compose agent processes events in several steps:

  • Optionally filter events at the input terminals, then use a context to route them to the appropriate agent instance or instances. section 8.2.4
  • Accumulate events in each instance. When a new event arrives on either input, pair it with previously received events from the other input. section 8.2.4
  • Test each pair against a match condition. For every pair that satisfies it, derive an output event from the two inputs. section 8.2.4
Figure 8.14. The Compose event processing agent

The diagram shows the logical structure of a compose agent, including its two inputs, matching operation, and derivation step. section 8.2.4

Matching vehicle arrivals and departures

Cameras at either end of a highway section produce arrival and departure events. Each event contains a vehicle registration mark and an occurrence timestamp. A compose agent can match an arrival with a departure for the same vehicle, allowing the highway authority to see how long the vehicle spent on that section of road. section 8.2.4

Unlike an aggregate agent, which operates on successive events in one stream, a compose agent matches events across two streams. Matching and correlation also connect compose agents to pattern detection. section 8.2.4 section 8.5

How Event Processing in Action covers it

How deep it goes
Explains filtering, context routing, event accumulation, matching, and derivation; develops matching further through pattern detection.
Examples
Matches highway vehicle arrival and departure events by registration mark to determine time spent on a road section.
What you can do after
Evaluate and understand how a compose agent pairs events and derives outputs from matches.
How it connects
Connects event processing agents with relational joins, filtering, contexts, aggregation, and pattern detection.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Event Processing in Action. The section links point to the parts of the book it draws on.