Class SequenceSizeReleaseStrategy

java.lang.Object
org.springframework.integration.aggregator.SequenceSizeReleaseStrategy
All Implemented Interfaces:
ReleaseStrategy

public class SequenceSizeReleaseStrategy extends Object implements ReleaseStrategy
An implementation of ReleaseStrategy that simply compares the current size of the message list to the expected 'sequenceSize'. Supports release of partial sequences. Correlating message handlers prevent the addition of duplicate sequences to the group.
Author:
Mark Fisher, Marius Bogoevici, Dave Syer, Iwein Fuld, Oleg Zhurakousky, Artem Bilan, Enrique Rodriguez
  • Constructor Details

    • SequenceSizeReleaseStrategy

      public SequenceSizeReleaseStrategy()
      Construct an instance that does not support releasing partial sequences.
    • SequenceSizeReleaseStrategy

      public SequenceSizeReleaseStrategy(boolean releasePartialSequences)
      Construct an instance that supports releasing partial sequences if releasePartialSequences is true. This can be an expensive operation on large groups.
      Parameters:
      releasePartialSequences - true to allow the release of partial sequences.
  • Method Details

    • setReleasePartialSequences

      public void setReleasePartialSequences(boolean releasePartialSequences)
      Flag that determines if partial sequences are allowed. If true then as soon as enough messages arrive that can be ordered they will be released, provided they all have sequence numbers greater than those already released. This can be an expensive operation for large groups.
      Parameters:
      releasePartialSequences - true when partial sequences should be released.
    • canRelease

      public boolean canRelease(MessageGroup messageGroup)
      Specified by:
      canRelease in interface ReleaseStrategy