I change your sample to respect the my schema more precisely - it is attached here ForumTest.zip. The main change is use of RecipientListRouter - that generates the sequence and the ReleaseStrategy on two aggregators is changed to MessageCount instead of default SequenceStrategy.
The problem occurred when the sequenceSize=1 (as recipientList size is 1 too), the message should be stored in aggregator and should wait for second message (as defined by configured MessageCountReleaseStrategy). But instead of this behaviour, the CorrelatingMessageHandler executes the lines 186-196 where is following code:
Code:
} else if (group.isComplete()) {
try {
// If not releasing any messages the group might still be complete
for (Message<?> discard : group.getUnmarked()) {
discardChannel.send(discard);
}
}finally {
remove(group);
}
so the sequenceSize=1, there is 1 message in group => this IF is TRUE and the message is discarded and group removed from MessageStore. But this is bad for me, because the sequence on message should not be used by this aggregator, here I have different strategy for release (MessageCountStrategy), the SequenseStrategy is later on Reply-aggregator.
It looks like bug, but Iīm not sure.
"that is why we expose custom strategies where such behavior could be customized." - great, please could you provide me some info, how can I use my own SequenceStrategy on Router ? I can not find any plugable attribute for this, only applySequence=true. I need to put my own sequence into header on RecipientListRouter, but as I look at implementation, there is no support for any kind of SequenceStrategy in routers. I use the 2.0.3RELEASE, is there some better support in some other versions?
Thank you for any idea.