The Aggregate mediator implements the Message Aggregator enterprise integration pattern and aggregates the response messages for messages that were split by the Clone or Iterate mediator and sent using the Send mediator. At the same time, it can aggregate messages in the presence of matching elements specified by the correlateOn
XPath expression. The Aggregate mediator collects the incoming messages until the completion condition is satisfied. The completion condition can specify a minimum or maximum number of messages to be collected, or a timeout value in seconds, after which the aggregation terminates. Note that when the Iterate mediator is used to split the requests and produces only an n number of fragmented messages, the Aggregate mediator will terminate as soon as it receives n responses, even if you have specified a higher minimum limit.
...
Info | ||
---|---|---|
| ||
You can configure the mediator using XML. Click switch to source view in the Mediator window. |
...
Examples
Table of Contents | ||||
---|---|---|---|---|
|
...
Parameter | Description |
---|---|
<property name="info" scope="default"> <ns:Information xmlns:ns="www.asankatechtalks.com" /> </property> | This creates the property named info of the OM type in which all the aggregated responses are accumulated. |
< aggregate id = "sa" > | The ID of the corresponding Clone mediator that splits the messages to be aggregated by the Aggregate mediator. |
< onComplete expression = "$body/*[1]" enclosingElementProperty = "info" > | This expression is used to add the info property (created earlier in this configuration) to be added to the payload of the message and for accumulating all the aggregated messages from different endpoints inside the tag created inside this property. |
< send /> | This is the Send mediator added as a child mediator to the Aggregate mediator in order to send the aggregated and annotated messages back to the client once the aggregation is complete. |
...
- Sample 62: Routing a Message to a Dynamic List of Recipients and Aggregating Responses
- Sample 400: Message Splitting and Aggregating the Responses
- Sample 751: Message Split Aggregate Using Templates
...