public class GroupBasedAggregatorOperations extends AbstractAggregatorOperations
| Constructor and Description |
|---|
GroupBasedAggregatorOperations() |
| Modifier and Type | Method and Description |
|---|---|
void |
aggregateByGroup(GroupBasedAggregatorParameterGroup aggregatorParameters,
IncrementalAggregationRoute incrementalAggregationRoute,
AggregationCompleteRoute onAggregationCompleteRoute,
org.mule.runtime.extension.api.runtime.process.RouterCompletionCallback completionCallback)
Aggregates a new event to the group and executes the routes and listeners if it corresponds.
|
@Alias(value="groupBasedAggregator") @Throws(value=GroupBasedAggregatorErrorProvider.class) public void aggregateByGroup(@ParameterGroup(name="Aggregator config") GroupBasedAggregatorParameterGroup aggregatorParameters, @ChainInputResolver(value=AggregationChainInputResolver.class) @ExecutionOccurrence(value=ONCE_OR_NONE) @Alias(value="incrementalAggregation") @Optional IncrementalAggregationRoute incrementalAggregationRoute, @ChainInputResolver(value=AggregationChainInputResolver.class) @ExecutionOccurrence(value=ONCE_OR_NONE) @Alias(value="aggregationComplete") AggregationCompleteRoute onAggregationCompleteRoute, org.mule.runtime.extension.api.runtime.process.RouterCompletionCallback completionCallback) throws org.mule.runtime.extension.api.exception.ModuleException
aggregatorParameters for the group, 2 things will happen:
onAggregationCompleteRoute will be executed with the aggregated elements of that particular groupincrementalAggregationRoute is not null, and the maxSize was not reached,
then it's chain will be executed with all aggregated events, including the last one.
The aggregator can also have a timeout defined. In that case, an scheduled task with that timeout as delay
will be registered for execution. The time will be computed from the time in which the first element arrives and
no extra tasks will be scheduled if there is another one waiting to be executed.
If the group reaches a timeout, it will be marked as timedout and every new element that arrive for that group will raise an exception.
In the case of a timeout, the hooked listener will be executed only if it supports being called by timeout.
Once a particular group is marked as timedout or complete, a group eviction will be scheduled with a delay specified by the parameter.
On group eviction, the group will be reset and will be able to aggregate new elements.aggregatorParameters - the parameters that configute the aggregatorincrementalAggregationRoute - a route executed for every new event until the maxSize is reachedonAggregationCompleteRoute - a route executed when maxSize is reachedcompletionCallback - callback to be called when the router has finishedorg.mule.runtime.extension.api.exception.ModuleExceptionCopyright © 2024 MuleSoft, Inc.. All rights reserved.