Back to Catalog
Integration
Message Routing
Aggregator
Collect related messages and merge them into one — the counterpart to Splitter.
Intent & Description
Real-world Use Case
Scatter-Gather price comparison — request sent to 5 supplier services. Each replies with a PriceQuote message sharing a requestCorrelationId. Aggregator waits for all 5 (or 10-second timeout), merges quotes into a PriceComparisonResult, emits to the requester. Best price wins.
Source
📌 TL;DR
Aggregator = wait for all the pieces, then merge them. The other half of Splitter and Scatter-Gather. Buffer, correlate, combine, emit. Watch out for memory and timeout edge cases.
Advantages
- Reassembles split or scattered processing back into a coherent result
- Handles partial responses with timeout-based completion
- Correlation-based grouping works across async, distributed processing
- Essential counterpart to Splitter and Scatter-Gather
Disadvantages
- Buffer memory grows with in-flight messages — needs bounds and TTL
- Completion condition design is subtle — timeouts vs count-based vs signal-based
- Partial failures (one message never arrives) need explicit handling
- State management is complex in distributed, multi-node setups