# cAggregate

Combines a number of messages together into a single message.

For more information, see the Apache camel documentation https://camel.apache.org/components/latest/.

## cAggregate Standard properties

These properties are used to configure cAggregate running in the Standard Job framework.

The Standard cAggregate component belongs to the Routing family.

## Basic settings

| Properties | Description |
| --- | --- |
| Language | Select the language of the expression you want to use to filter your<br>messages, from None, Bean, CONSTANT, ESBCorrelationID, EL,<br>GROOVY, HEADER, JoSQL,<br>JSonPath, JXPATH, MVEL,<br>OGNL, PHP, PROPERTY,<br>PYTHON, RUBY, SIMPLE,<br>SpEL, SQL, XPATH, and<br>XQUERY.<br><br>Select CorrelationID to use the<br>existing correlation ID of the message as the correlation key if the<br>correlation ID is available in the closest cSOAP connected to this component. For more information<br>about the cSOAP component, see [cSOAP](https://help.qlik.com/talend/en-US/components/8.0/mediation-apache-cxf/csoap). |
| Correlation expression/Expression | Type in the expression that evaluates the correlation key to be<br>used for the aggregation.<br><br>This field disappears when CorrelationID is selected in the Language list. In this case, the existing correlation<br>ID from the closest cSOAP connected<br>to this component will be used. For more information about the<br>cSOAP component, see [cSOAP](https://help.qlik.com/talend/en-US/components/8.0/mediation-apache-cxf/csoap). |
| Correlation expression/Add Namespaces | This option appears when XPath is<br>selected in the Language list.<br><br>Select this check box to add namespaces for the Xpath expression.<br>Click [+] to add as many namespaces<br>as required to the table and define the prefix and URI in the<br>corresponding columns. |
| Strategy | Specify a Java bean to use as the aggregation strategy or select a<br>predefined aggregation strategy.<br><br><ul> <li> <span>UseOriginalAggregationStrategy</span>: Use the original                        exchange.</li> <li> <span>UseLatestAggregationStrategy</span>: Use the latest                        exchange.</li> <li> <span>GroupedMessageAggregationStrategy</span>: Aggregate all                        messages into a single combined exchange holding all the aggregated messages                        in a list of messages as the message body.</li> <li> <span>GroupedExchangeAggregationStrategy</span>: Aggregate all                        exchanges into a single combined exchange holding all the aggregated                        exchanges in a list of exchanges as the message body. </li> <li> <span>GroupedBodyAggregationStrategy</span>: Aggregate body of                        input messages into a single combined exchange holding all the aggregated                        bodies in a list of objects as the message body.</li> </ul><br><br>Information noteNote: The predefined aggregation strategies are available only if you have<br>installed the R2024-10 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator. |
| Completion conditions/Number of messages | Select this check box to specify the number of messages to<br>aggregate per batch before the aggregation is complete.<br><br>Information noteNote:<br><br>By default, this check box is selected and the number of<br>messages is set to *3*. If you<br>clear this check box, and at least one of the other four<br>completion conditions is met, all the messages retrieved will be<br>aggregated in one batch. |
| Completion conditions/Inactivity timeout (in milliseconds) | Select this check box to specify the time (in milliseconds) that<br>an aggregated exchange should be inactive before it is complete.<br>This option can be set as either a fixed value or using an<br>Expression which allows you to evaluate a timeout dynamically.<br><br>Information noteNote:<br><br>You can not use this option together with Scheduled interval. Only one of them<br>can be used at a time. |
| Completion conditions/Scheduled interval (in milliseconds) | Select this check box to specify a repeating period (in<br>milliseconds) by which the aggregator will complete all current<br>aggregated exchanges.<br><br>Information noteNote:<br><br>You cannot use this option together with Inactivity timeout. Only one of them can be used<br>at a time. |
| Completion conditions/Predicate matched | Select this check box to specify a predicate to indicate<br>when an aggregated exchange is complete. |
| Completion conditions/Batch consumer | Select this check box to aggregate all files consumed<br>from a file endpoint in a given poll. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Check completion before aggregating | Select this check box to check for completion when a new<br>incoming exchange has been received. This option influences the behavior<br>of the Predicate matched option as the<br>exchange being passed in changes accordingly. When this option is<br>disabled, the exchange passed in the predicate is the *aggregated* exchange which means any<br>information you may store on the aggregated exchange from the<br>aggregation strategy is available for the predicate. When this option is<br>enabled, the exchange passed in the predicate is the *incoming* exchange, which means you can<br>access data from the incoming exchange. |
| Close correlation group | Select this check box to indicate that if a correlation<br>key has already been completed, then any new exchanges with the same<br>correlation key will be denied. When using this option, enter a number<br>in the Maximum bound field to keep that<br>last number of closed correlation keys. |
| Ignore invalid correlation key | Select this check box to ignore the invalid correlation<br>key which could not be evaluated to a value. By default Camel will throw<br>an Exception on encountering an invalid correlation key. |
| Group arriving exchange | Select this check box to group all aggregated exchanges<br>into a single combined holder class that holds all the aggregated<br>exchanges. As a result only one exchange is being sent out from the<br>aggregator. This option can be used to combine many incoming exchanges<br>into a single output exchange. |
| Use persistence | Select this check box to plug in your own implementation<br>of the repository which keeps track of the current in-flight aggregated<br>exchanges. By default, Camel uses a memory based implementation. |
| Repository | This field appears when the Use persistence<br>check box is selected. The repository is AggregationRepository or RecoverableAggregationRepository.<br><br><br>AggregationRepository:<br>The default repository used by Camel which is a memory based<br>implementation. Enter the name of the repository in the field.<br><br><br>RecoverableAggregationRepository:<br>RecoverableAggregationRepository is a JDBC based<br>AggregationRepository which persists the aggregated messages on the<br>fly. This ensures that you will not loose messages. Enter the name<br>of the repository in the field.<br><br>With this repository selected, the following options<br>appear:<br><br><br>Recovery/Use recovery: Select<br>this check box to recover failed aggregated exchanges and have them<br>resubmitted automatically. In the Recovery<br>interval field, enter the interval (in milliseconds)<br>to scan for failed exchanges to recover and resubmit. By default<br>this interval is 5000 milliseconds. In the Dead letter channel field, enter an endpoint URI for<br>a Dead Letter Channel where exhausted recovered exchanges will be<br>moved. In the Maximum redeliveries<br>field, enter the maximum number of redelivery attempts for a given<br>recovered exchange. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | cAggregate is used as a middle or<br>end component in a Route. |
| Connections | Aggregate: select this link to route<br>messages to the next endpoint according to the selected aggregation<br>strategy.<br><br><br>Route: select this link to route all the messages from the<br>sender to the next endpoint. |

**Related concepts**

* [Aggregating three messages into one](https://help.qlik.com/talend/en-US/mediation-components/8.0/mediation-aggregate/caggregate-cprocessor-cfile-cfile-aggregating-three-messages-into-one)