liveBook · Manning

Aggregator

As explained in Akka in Action, Second Edition

An aggregator is an actor or component that combines multiple processing results associated with the same original message.

An aggregator combines multiple results produced from one original message. It must receive every related result at the same destination; otherwise, it may fail to merge them or combine unrelated results unnoticed. section 6.3.4

Joining obfuscated and enriched data

A manager splits a message between a data-obfuscation worker and a data-enrichment worker. Both workers send their results to an aggregator. Consistent-hashing routers select the same aggregator using the original message identifier, keeping the two pieces together. section 6.3.4

Figure 6.6 Distributing and aggregating messages
CH06_F06_Abraham2

Trace how parallel worker outputs can reach different aggregators and why message affinity is required. section 6.3.4

Preserve aggregation affinity by:

  • Defining a stable identifier for each original message. section 6.3.4
  • Routing worker results with consistent hashing so matching identifiers select the same routee. section 6.3.4
  • Using a group router when routees register or deregister dynamically. section 6.3.4

How Akka in Action, Second Edition covers it

How deep it goes
Explains the routing failure, consistent-hashing remedy, and Akka configuration pattern without detailing aggregation state management.
Examples
Uses data obfuscation, third-party enrichment, worker outputs, message identifiers, and aggregator routing diagrams.
What it assumes
Assumes familiarity with actors, workers, routers, routees, and splitting one message into parallel work.
What you can do after
Configure Akka group routers with consistent hashing to keep related worker results together.
How it connects
Connects actors, routers, consistent hashing, group routers, pool routers, and message partitioning.

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