SpringSource/spring-integration — pull request #714 by artembilan (2013-01-24 23:22:54+00:00)
Title: INT-2899: fix aggregator overhead on startup

If is configured with expire-groups-upon-completion="true"
and message-store="persistentMessageStore", it causes blocking of the main deploy Thread,
if there are a lot of Messages in the persistent MessageStore.

* Add to `AggregatingMessageHandler` implementation of `ApplicationListener`
to handle iteration over MessageStore as late as possible.
* Wrap 'iteration over MessageStore' to scheduled task to avoid overhead of the main Thread
* allow call 'iteration over MessageStore' from `setExpireGroupsUponCompletion` only when `AggregatingMessageHandler#initialized = true`,
who is switched on on the `onInit()`
* Add verification test `AggregatorSupportedUseCasesTests#testInt2899VerifyMessageStoreCalls`

JIRA: https://jira.springsource.org/browse/INT-2899