服务器重启时的聚合器行为 - spring 集成

Aggregator behavior on server restart - spring integration

前提 -

在 spring 集成中,如果我有一个消息组不完整的聚合器。满足组发布策略前,重启服务器

我的期望不正确吗?有人可以指导吗?

我认为我们可以通过 MessageGroupStoreReaper 满足您的要求,您将 运行 在服务器启动时,例如通过捕捉 ContextRefreshedEvent:

The MessageGroupStore maintains a list of these callbacks which it applies, on demand, to all messages whose timestamp is earlier than a time supplied as a parameter (see the registerMessageGroupExpiryCallback(..) and expireMessageGroups(..) methods above).

The expireMessageGroups method can be called with a timeout value. Any message older than the current time minus this value will be expired, and have the callbacks applied. Thus it is the user of the store that defines what is meant by message group "expiry".

http://docs.spring.io/spring-integration/reference/html/messaging-routing-chapter.html#reaper