Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The release strategy of an aggregator dictates at which point the
collected messages should be sent or released for aggregation. Until and
unless the signal is sent, the framework stores the messages, except
when a release-on-expire flag is
set.
The default strategy is represented by SequenceSizeReleaseStrategy, which implements
a ReleaseStrategy interface. It works
on the algorithm that checks the presence of messages grouped by
SEQUENCE_SIZE. For example, if the
SEQUENCE_SIZE is 10, the strategy will trigger a signal to the
aggregator to begin only after it receives all 10 messages with sequence
numbers ranging from 1 to 10.
Similar to CorrelationStrategy,
you can either implement the framework’s ReleaseStrategy or create your own custom class
that can signal the release. The following code implements Framework’s
interface: