diff --git a/spring-integration-reference/src/aggregator-resequencer.xml b/spring-integration-reference/src/aggregator.xml similarity index 73% rename from spring-integration-reference/src/aggregator-resequencer.xml rename to spring-integration-reference/src/aggregator.xml index fd4c34d083..2f854a6b3a 100644 --- a/spring-integration-reference/src/aggregator-resequencer.xml +++ b/spring-integration-reference/src/aggregator.xml @@ -1,10 +1,10 @@ - - Aggregation and Resequencing + + Message Aggregation -
+
Introduction Basically a mirror-image of the Splitter, the Aggregator is a type @@ -18,18 +18,11 @@ necessary. Furthermore, in case of a timeout, the Aggregator needs to know whether to send the partial results or to discard them to a separate channel. - - Related to the Aggregator, albeit different from a functional - standpoint, is the Resequencer. In this chapter, we will treat them - together because of their similar functionalities.
-
+
Functionality -
- Aggregation - The Aggregator combines a group of related messages, by storing and grouping them, until the group is deemed complete. At that point, the Aggregator will create a single message by processing the whole @@ -54,33 +47,10 @@ if late messages arrive after the aggregation has taken place? In this case, a configuration option allows the user to decide whether they should be discarded or not. -
- -
- Resequencing - - The Resequencer works in a similar way to the Aggregator, in the - sense that it uses the CORRELATION_ID to store messages in groups, the - difference being that all what the Resequencer does, is to release them - in the order of their SEQUENCE_NUMBER. - - With respect to that, the user might opt to release all messages - at once (after the whole sequence, according to the SEQUENCE_SIZE, has - been released), or as soon as a valid sequence is available. Another - option is to set a timeout, deciding whether to drop the whole sequence - if the timeout has expired, and not all messages have arrived, or to - release the messages accumulated so far, in the appropriate - order. -
-
- The API - - - -
- Programming with Aggregator +
+ The Aggregator API The Aggregation API consists of a number of classes: @@ -203,14 +173,10 @@ SEQUENCE_NUMBER and SEQUENCE_SIZE of the arriving messages for deciding when a message group is complete and ready to be aggregated. -
-
- Configuration using XML - -
- Configuring an aggregator through XML +
+ Configuring an Aggregator with XML Spring Integration supports the configuration of an aggregator via XML through the <aggregator/> element. A completely defined sample @@ -353,99 +319,10 @@ } }Wherever it makes sense, the completion strategy method and the aggregator method can be combined in a single bean. -
- -
- Configuring a resequencer by using XML - - Configuring a resequencer requires only including the appropriate - element in XML. - - A sample resequencer configuration is shown below. - - <channel id="inputChannel"/> - -<channel id="outputChannel"/> - -<resequencer id="completelyDefinedResequencer" - input-channel="inputChannel" - output-channel="outputChannel" - discard-channel="discardChannel" - release-partial-sequences="true" - timeout="42" - send-partial-result-on-timeout="true" - reaper-interval="135" - tracked-correlation-id-capacity="99" - send-timeout="86420000" /> - - - - The id of the resequencer is - optional. - - - - The input channel of the resequencer. - Required. - - - - The channel where the resequencer will send the reordered - messages. Optional. - - - - The channel where the resequencer will send the messages - that timed out (if send-partial-result-on-timeout is - false). Optional. - - - - Whether to send out ordered sequences as soon as they are - available, or only after the whole message group arrives. - Optional (true by default). - - - - The timeout for reordering message sequences (counted from - the arrival of the first message). - Optional. - - - - Whether, upon the expiration of the timeout, the ordered - group shall be sent out (even if some of the messages are - missing). Optional (false by default). - - - - The interval (in milliseconds) at which a reaper task is - executed, checking if there are any timed out groups. - Optional. - - - - The capacity of the correlation id tracker. Remembers the - already processed correlation ids, preventing the formation of new - groups for messages that arrive after their group has been already - processed (reordered or discarded). - Optional. - - - - The timeout for sending out messages. - Optional. - - -
-
- Configuration using annotations - - This section will cover only the configuration for aggregators. - Since there is no custom behaviour to be implemented in Java classes for - resequencers, there is no annotation support for it. +
+ Configuration an Aggregator with Annotations An aggregator configured using annotations can look like this. @@ -485,7 +362,7 @@ All the configuration options provided by xml element are available for the @Aggregator annotation. - The aggregator can be either referenced explicitely from XML or, if + The aggregator can be either referenced explicitly from XML or, if the @MessageEndpoint is defined on the class, detected automatically through classpath scanning.
diff --git a/spring-integration-reference/src/resequencer.xml b/spring-integration-reference/src/resequencer.xml new file mode 100644 index 0000000000..3a655f0b81 --- /dev/null +++ b/spring-integration-reference/src/resequencer.xml @@ -0,0 +1,120 @@ + + + + Resequencer + +
+ Introduction + + Related to the Aggregator, albeit different from a functional + standpoint, is the Resequencer. In this chapter, we will treat them + together because of their similar functionalities. +
+ +
+ Functionality + + The Resequencer works in a similar way to the Aggregator, in the + sense that it uses the CORRELATION_ID to store messages in groups, the + difference being that all what the Resequencer does, is to release them + in the order of their SEQUENCE_NUMBER. + + With respect to that, the user might opt to release all messages + at once (after the whole sequence, according to the SEQUENCE_SIZE, has + been released), or as soon as a valid sequence is available. Another + option is to set a timeout, deciding whether to drop the whole sequence + if the timeout has expired, and not all messages have arrived, or to + release the messages accumulated so far, in the appropriate + order. +
+ +
+ Configuring a Resequencer with XML + + Configuring a resequencer requires only including the appropriate + element in XML. + + A sample resequencer configuration is shown below. + + <channel id="inputChannel"/> + +<channel id="outputChannel"/> + +<resequencer id="completelyDefinedResequencer" + input-channel="inputChannel" + output-channel="outputChannel" + discard-channel="discardChannel" + release-partial-sequences="true" + timeout="42" + send-partial-result-on-timeout="true" + reaper-interval="135" + tracked-correlation-id-capacity="99" + send-timeout="86420000" /> + + + + The id of the resequencer is + optional. + + + + The input channel of the resequencer. + Required. + + + + The channel where the resequencer will send the reordered + messages. Optional. + + + + The channel where the resequencer will send the messages + that timed out (if send-partial-result-on-timeout is + false). Optional. + + + + Whether to send out ordered sequences as soon as they are + available, or only after the whole message group arrives. + Optional (true by default). + + + + The timeout for reordering message sequences (counted from + the arrival of the first message). + Optional. + + + + Whether, upon the expiration of the timeout, the ordered + group shall be sent out (even if some of the messages are + missing). Optional (false by default). + + + + The interval (in milliseconds) at which a reaper task is + executed, checking if there are any timed out groups. + Optional. + + + + The capacity of the correlation id tracker. Remembers the + already processed correlation ids, preventing the formation of new + groups for messages that arrive after their group has been already + processed (reordered or discarded). + Optional. + + + + The timeout for sending out messages. + Optional. + + + + + Since there is no custom behaviour to be implemented in Java classes for + resequencers, there is no annotation support for it. + +
+
diff --git a/spring-integration-reference/src/spring-integration-reference.xml b/spring-integration-reference/src/spring-integration-reference.xml index 77f5c02e0d..c6db4819fd 100644 --- a/spring-integration-reference/src/spring-integration-reference.xml +++ b/spring-integration-reference/src/spring-integration-reference.xml @@ -47,7 +47,8 @@ - + +