Using Aggregators in a Cluster

Aggregators don’t work with multiple workers and a persistent object store, because clustering is not available in CloudHub. To learn how you can either share or double workers to scale your application and provide high availability, see the CloudHub Fabric documentation.

Aggregators Module works in a cluster out-of-the-box environment. However, to prevent an unexpected behavior consider the following:

When an asynchronous aggregation is defined and the first element arrives, it is scheduled in the primary node of the cluster. Because new values can arrive in any node of the cluster, we need a way to notify and make the primary node schedule that aggregation. To do that, another task in the primary node periodically determines whether it is necessary to schedule a new aggregation or not. This can lead to a problem if the interval between checks for new aggregation scheduling is much longer than the actual timeout of the aggregation, because the aggregation could be over before it is scheduled, or there might be errors in the time computation.

To avoid this issue, configure the frequency at which the primary node checks for new aggregations to schedule. Define this value using either:

  • The global configuration property mule.aggregatorsSchedulingPeriod (in milliseconds)

  • The system property -M-Dmule.aggregatorsSchedulingPeriod

For further information about how to configure global or system properties, see the configuring properties documentation.