Overview

Chapter 6. The event processing network

Event processing networks are presented as the central modeling concept for describing how an event-driven application works. The chapter explains that an EPN connects event producers and consumers through intermediary processing elements, and that its notation uses nodes, terminals, and links to show how event instances move through the system. It also highlights that networks can include feedback, nesting, and explicit channels, making the model both expressive and reusable while still remaining an abstraction of the actual runtime implementation.

The discussion then turns to the main processing component, the event processing agent. EPAs are described in terms of three logical functions: filtering, matching, and derivation, and several common EPA types are introduced, including Filter, Transformation, Translate, Enrich, Project, Aggregate, Split, Compose, and Pattern detect. These agent types are explained as different ways of selecting events, combining them, transforming them, or deriving new events, with examples showing how they can be chained together to build more complex behavior in a modular way.

The chapter also explains event channels and global state elements as essential parts of the network. Channels route events between processing elements using schemes such as fixed, type-based, and content-based routing, while global state provides shared reference data, historical data, or application state that EPAs can read or update. A worked example based on the Fast Flower Delivery application ties these ideas together by showing how multiple systems use EPAs, channels, and shared state to handle requests, assignments, alerts, rankings, and reports, and the chapter closes by emphasizing the practical value of explicit EPN models for understanding, validating, and optimizing event processing systems.

An example event processing network, showing the graphical notation we are using, and illustrating some of the features of an EPN
An example of feedback in an event processing network. Some of the events emitted by agent 2 are fed back into agent 1.
An example showing nested event processing networks. The upper part of the figure shows an EPN with four nodes. Two of these (A2 and A3) are agents that contain nested EPNs. The lower half of the figure shows the full network with these nodes expanded to reveal the agents inside them.
How an event processing network model (shown at top left) can be mapped to the runtime artifacts that implement it in an event processing platform
An example showing the internals of an event processing agent that contains all three logical functions
Event processing agent types. This diagram shows an inheritance hierarchy, for example, Enrich and Project are special cases of Translate, which in turn is a special case of Transformation.
The Filter EPA showing the Input terminal and three output terminals
The Transformation EPA
Six subtypes of the Transformation EPAs, showing the inputs, outputs, and transformation type
Generic event processing agent definition element
The bid request system, showing its two Enrich event processing agents
Location service event processing agent
Event processing agents that make up the assignment system
The event processing agents that make up the control system
The event processing agents in the ranking and reporting system
The definition element describing an event channel
The definition element describing a global state element
An example of using a graphical user interface to define an event processing network. This example uses StreamBase StreamSQL Event Flow.
An explicit event processing network representation from Event Zero. Note that the EPN semantics in this illustration differ slightly from those we use in this book, but the principle is similar.

FAQ

What is an event processing network (EPN)?An event processing network is the central model used in the chapter to describe how an event processing application is structured. It links event producers and event consumers through intermediate processing elements, mainly event processing agents, event channels, and global state elements.
What are the main building blocks of an EPN?The chapter identifies three main intermediate building blocks in addition to producers and consumers: event processing agents (EPAs), event channels, and global state elements. EPAs perform processing, channels route events, and global state elements provide shared data for agents to use.
How are links represented in an EPN diagram?Links are shown as solid lines connecting output terminals to input terminals. They represent the flow of event instances through the network. If one output terminal connects to multiple links, the emitted event is distributed as separate copies.
What happens when multiple links connect to the same input terminal?Events arriving on those links are interleaved at the input terminal. The exact interleaving order depends on the implementation. If a specific order is needed, the book suggests using a Pattern detect EPA or an explicit Compose agent.
What is the purpose of nested event processing networks?Nesting lets you place an EPN inside an event processing agent node, which makes large networks easier to understand and supports hierarchical design and reuse. The input and output terminals of the outer agent correspond to producers and consumers in the nested network.
What are the three logical functions of an event processing agent?An EPA can perform filtering, matching, and derivation. Filtering selects which events are processed, matching finds event patterns or matching sets, and derivation creates new events from those matches or inputs.
What is the difference between a Filter EPA and a Transformation EPA?A Filter EPA only filters events and does not transform them. A Transformation EPA includes derivation, and may also include filtering, so it can create new derived events from the input.
What are the main types of Transformation EPAs?The chapter describes Translate, Enrich, Project, Aggregate, Split, and Compose. Translate converts one event into another, Enrich adds or corrects data using global state, Project keeps only selected attributes, Aggregate combines multiple events into one, Split creates multiple events from one, and Compose combines events from two input terminals.
What is an event channel and why use one explicitly?An event channel routes event instances from source processing elements to target processing elements. Making a channel explicit helps document routing behavior clearly, supports more complex routing schemes, and allows the channel itself to be modeled as part of the EPN.
What is global state in an EPN?Global state is shared data that can be read or updated by event processing agents. It may include event stores, reference data, external state, or event processing state. In the Fast Flower Delivery example, global state includes Neighborhoods, Driver status, and Store reference.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Event Processing in Action Event Processing in Action ebook for free