Aggregator Pattern (Message Aggregation)
Learn Aggregator Pattern (Message Aggregation) (Message Routing & Transformation Patterns, Integration & Messaging Patterns) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
What is the (Message) Aggregator Pattern? An Aggregator collects a series of related individual messages and combines them into one composite message once some completion condition is met (e.g. all expected pieces have arrived, or a timeout elapses). It is the direct inverse of the Splitter pattern. Completion Strategies • Count-based - complete once N messages with the same correlation ID have arrived. • Timeout-based - complete after a fixed time window, using whatever arrived so far. • Predicate-based - complete once a custom condition on the collected messages is satisfied.