3

Implementing Aggregators Module With MuleSoft

 3 years ago
source link: https://dzone.com/articles/implementing-aggregators-module-with-mulesoft
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Introduction

The MuleSoft Aggregators module provides three types of Aggregators, which collect and release data depending on the conditions configured. The aggregator module will receive the data and, depending on the expression, it will extract the data and send it for aggregation and release or complete the aggregation.

Common Configuration

Object Store

All information related to Aggregators is stored in Object Store and it can persistent as well as transient (In-Memory) Object Store.

The Persistent Object Store is reliable, and data can persist even if the application restarts, but it is slower.

The In-Memory Object Store is faster, but data cannot be recovered if the application restarts.

Content

The expression that defines what to aggregate. The result of the evaluation is the value stored in the aggregation.

Type of Aggregators

  • Size-Based Aggregator
  • Time-Based Aggregator
  • Group-Based Aggregator

The Size-Based Aggregator aggregates the data until predefined size limits reached, executing routes and listeners.

  • Max Size is the total number of the elements to be aggregated before we mark aggregation to be complete or release.
  • Timeout is the maximum time to wait for aggregation to complete or release.

Here is the video tutorial explaining the Size-Based Aggregator.

Time-Based Aggregator aggregates the data until the time period is completed, executing routes and listeners.

  • Period is the maximum time to wait before aggregation to complete or release.

Here is the video tutorial explaining the Time-Based Aggregator.

Group-Based Aggregator aggregates in the group according to GroupId, executing routes and listeners.

  • Group Id is the expression to be evaluated for every new message received in order to get the ID for the group where it should be aggregated. 
  • Group Size is the maximum size to assign to the group with the group ID resolved.
  • Eviction Time is the time to remember a group ID once it was completed or timed out (0 means: don’t remember, -1: remember forever).

Here is the video tutorial explaining the Group-Based Aggregator.

Now, you know how to implement the Aggregator module with MuleSoft.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK