From 233aaffb3b0fef95662c42c5dfe6bec2a472f377 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Mon, 24 Feb 2014 17:34:40 -0500 Subject: [PATCH] INT-3306 Document Release Strategy POJO Limitation JIRA: https://jira.springsource.org/browse/INT-3306 Add a caution about using POJO ReleaseStrategy with large groups. --- src/reference/docbook/aggregator.xml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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