Spring 集成 - 聚合优先通道

Spring Integration - Aggregating Priority Channel

我在 spring 集成中使用了 Aggregator,还看到有 PriorityChannel。是否有可能以某种方式使用其中两个来实现以下要求:

  1. 从 RabbitMQ 接收消息并存储在具有聚合器
  2. 的spring组件中
  3. 聚合器正在进行聚合,但同时它会根据一些复杂的排序算法对要发布的消息进行优先排序。
  4. 随着时间的推移,队列中的消息优先级可能会发生变化,我们需要能够在某个时间点重新安排优先级。

PriorityChannel 对此无济于事,但您可以在自定义 ReleaseStrategy...

中为所欲为
@FunctionalInterface
public interface ReleaseStrategy {

    boolean canRelease(MessageGroup group);

}