Troubleshoot Aggregators Module - Mule 4

To troubleshoot the Aggregators module, become familiar with the information about app logs, enabling verbose logging, and interpreting commonly thrown messages.

Use the Latest Aggregators Module Version

To ensure that you use the latest patches, update the Aggregator module to the latest version. In the Apache Maven pom.xml file generated by Anypoint Studio, replace x.x.x with the version that corresponds to the latest version:

<dependency>
  <groupId>org.mule.modules</groupId>
  <artifactId>mule-aggregators-module</artifactId>
  <version>x.x.x</version>
  <classifier>mule-plugin</classifier>
</dependency>

To obtain the most up-to-date pom.xml file information:

  1. Go to Anypoint Exchange.

  2. In Exchange, click Login and supply your Anypoint Platform username and password.

  3. In Exchange, search for aggregators.

  4. Select the connector.

  5. Click Dependency Snippets near the upper right of the screen.

Enable Verbose Logging

To begin troubleshooting Aggregator module, enable verbose logging to see the exact error messages:

  1. Access Anypoint Studio and navigate to the Package Explorer view.

  2. Open your application’s project.

  3. Open the src/main/resources path folder.

  4. Open the log4j2.xml file inside the folder.

  5. If the following line is already in the log4j2.xml file, uncomment it to enable it; otherwise, add it:

    <AsyncLogger name="org.mule.extension.aggregator" level="DEBUG"/>
  6. Save your changes.

  7. Click the project name in Package Explorer and then click Run > Run As > Mule Application.

  8. Navigate to the Console view to read the messages in the logger.

Understand the Timeout Behavior in the Size-Based Aggregator

For the Size based aggregator scope, the Timeout field indicates the maximum time to wait for the aggregation to complete. If the timeout is reached before the total number of elements is equal to the value set in the Max size field, the aggregation is not considered complete and the aggregation is reset. Note that you can use an Aggregator listener source to capture the elements that were aggregated before the timeout occurred. For further details on timeout behavior, see how to configure the Size-Based Aggregator Timeout and Max Size Fields documentation.

Make Sure You Are Not in a Multiple Worker Setting

Aggregators don’t work with multiple workers and a persistent object store because clustering is not available in CloudHub. For details on how workers can be shared or doubled to scale your application and provide high availability, see the CloudHub Fabric documentation.

Understand Common Throws

Here is a list of common throw messages and how to interpret them:

For Size based aggregator:

  • AGGREGATORS:AGGREGATOR_CONFIG

    The Max size or Timeout fields have invalid values, for example, Max size < 0.
  • AGGREGATORS:OBJECT_STORE_ACCESS

    An error occurred during an attempt to access the object store used to store the aggregated values.

For Time based aggregator:

  • AGGREGATORS:AGGREGATOR_CONFIG

    The Period or Max size fields have invalid values, for example, Period = 0.
  • AGGREGATORS:OBJECT_STORE_ACCESS

    An error occurred during an attempt to access the object store used to store the aggregated values.

For Group based aggregator:

  • AGGREGATORS:GROUP_COMPLETED

    An error occurred during an attempt to add a new element to an already completed group that was not yet evicted.
  • AGGREGATORS:GROUP_TIMED_OUT

    An error occurred during an attempt to add a new element to a group that timed out but had not yet been evicted.
  • AGGREGATORS:NO_GROUP_ID

    The expression that resolves to the group ID returns null.
  • AGGREGATORS:NO_GROUP_SIZE

    The expression that resolves to the group size returns null.
  • AGGREGATORS:AGGREGATOR_CONFIG

    The Group size or Timeout fields have invalid values, for example, groupSize < 0.
  • AGGREGATORS:OBJECT_STORE_ACCESS

    An error occurred during an attempt to access the object store used to store the aggregated values.