1

Premise -

In spring integration,if i have a aggregator with a message group which is incomplete. Before group release stratergy is met, server is restarted.

  • Current Behavior-> all the messages posted to the aggregator go to the same message group and not a new one, since it is not marked complete, messages keep flowing in.
  • Expected-> If server is restarted, aggregator picks the left over messages from message store, marks already persisted ones complete & then cater new ones,

Is my expectation incorrect? Can somebody guide?

4

1 回答 1

1

我认为我们可以通过 来满足您的要求MessageGroupStoreReaper,您只需在服务器启动时运行,例如通过 catch ContextRefreshedEvent

MessageGroupStore 维护这些回调的列表,它根据需要将其应用于时间戳早于作为参数提供的时间的所有消息(请参阅上面的 registerMessageGroupExpiryCallback(..) 和 expireMessageGroups(..) 方法)。

可以使用超时值调用 expireMessageGroups 方法。任何早于当前时间减去此值的消息都将过期,并应用回调。因此,商店的用户定义了消息组“到期”的含义。

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

于 2016-04-04T18:32:48.013 回答