Class MessageCountReleaseStrategy
java.lang.Object
org.springframework.integration.aggregator.MessageCountReleaseStrategy
- All Implemented Interfaces:
ReleaseStrategy
public class MessageCountReleaseStrategy extends Object implements ReleaseStrategy
- Author:
- Dave Syer, Oleg Zhurakousky, Artem Bilan
-
Constructor Summary
Constructors Constructor Description MessageCountReleaseStrategy()
Convenient constructor is only one message is required (threshold=1).MessageCountReleaseStrategy(int threshold)
Construct an instance based on the provided threshold. -
Method Summary
Modifier and Type Method Description boolean
canRelease(MessageGroup group)
Release the group if it has more messages than the threshold and has not previously been released.
-
Constructor Details
-
MessageCountReleaseStrategy
public MessageCountReleaseStrategy()Convenient constructor is only one message is required (threshold=1). -
MessageCountReleaseStrategy
public MessageCountReleaseStrategy(int threshold)Construct an instance based on the provided threshold.- Parameters:
threshold
- the number of messages to accept before releasing
-
-
Method Details
-
canRelease
Release the group if it has more messages than the threshold and has not previously been released. 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 interfaceReleaseStrategy
-