org.springframework.integration.aggregator
Class MessageCountReleaseStrategy
java.lang.Object
org.springframework.integration.aggregator.MessageCountReleaseStrategy
- All Implemented Interfaces:
- ReleaseStrategy
public class MessageCountReleaseStrategy
- extends Object
- implements ReleaseStrategy
A ReleaseStrategy
that releases only the first n
messages, where n
is a threshold.
- Author:
- Dave Syer
Method Summary |
boolean |
canRelease(MessageGroup group)
Release the group if it has more messages than the threshold and has not previously been released. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageCountReleaseStrategy
public MessageCountReleaseStrategy(int threshold)
- Parameters:
threshold
- the number of messages to accept before releasing
MessageCountReleaseStrategy
public MessageCountReleaseStrategy()
- Convenient constructor is only one message is required (threshold=1).
canRelease
public boolean canRelease(MessageGroup group)
- Release the group if it has more messages than the threshold and has not previously been released. Previous
releases leave an imprint on the group in the form of marked messages. It is possible that more messages than the
threshold could be released, but only if multiple consumers receive messages from the same group concurrently.
- Specified by:
canRelease
in interface ReleaseStrategy
Copyright © 2010. All Rights Reserved.