- All Implemented Interfaces:
public class MessageCountReleaseStrategy extends Object implements ReleaseStrategy
ReleaseStrategythat releases only the first
nis a threshold.
- Dave Syer, Oleg Zhurakousky, Artem Bilan
public MessageCountReleaseStrategy()Convenient constructor is only one message is required (threshold=1).
public MessageCountReleaseStrategy(int threshold)Construct an instance based on the provided threshold.
threshold- the number of messages to accept before releasing
public boolean canRelease(MessageGroup group)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.