diff --git a/src/reference/docbook/aggregator.xml b/src/reference/docbook/aggregator.xml index f555908915..612bfcc92c 100644 --- a/src/reference/docbook/aggregator.xml +++ b/src/reference/docbook/aggregator.xml @@ -256,7 +256,22 @@ anything other than Message). Typically this would satisf for some reason, you need to access the full MessageGroup then you should simply provide an implementation of the ReleaseStrategy interface. - + + + When handling potentially large groups, it is important to understand how these methods are invoked because the release + strategy may be invoked multiple times before the group is released. The most efficient is an implementation of + ReleaseStrategy because the aggregator can invoke it directly. The second most + efficient is a POJO method with a Collection<Message<?>> parameter type. The least efficient + is a POJO method with a Collection<Foo> type - the framework has to copy the payloads from the messages + in the group into a new collection (and possibly attempt conversion on the payloads to Foo) every time the + release strategy is called. Collection<?> avoids the conversion but still requires creating the + new Collection. + + + For these reasons, for large groups, it is recommended that you implement + ReleaseStrategy. + + When the group is released for aggregation, all its not-yet-released messages are processed and removed from the group. If the group is also complete (i.e. if all messages from a