I am not sure what you mean when you say "correlation is simple" but then go on to say you only want to release part of the group. If they have different dates then they will be in different groups, so there's no need to release part of a group, just release the whole group by running the reaper just after midnight (or any time the next day). It's not at all clear why you need a "done" message.
By default, the aggregator uses an in-memory message store (SimpleMessageStore
).
EDIT:
Just put the done
file in the same group and have your release strategy detect the presence of the done
file. You could use an expression, but if the group can be large, it would be more efficient to implement ReleaseStrategy
and iterate over MessageGroup.getMessages()
looking for the done
file.
The next step depends on what's downstream of the aggregator. If you use a splitter to split them back to separate files, you can simply add a filter to drop the done
file. If you deal with the collection of files directly, either ignore the done file, or add a transformer to remove it from the collection.
With respect to the reaper; assuming files arrive in real time, I was simply suggesting that if you, say, run the reaper once a day (say at 01:00) with a group timeout of, say 30 minutes, then the reaper will release yesterday's files (without the need for a done
file).
EDIT:
See my comment on your "answer" below - you have 2 subscribers on filesLogger
.