Spring integration 入站适配器跳过消息

Spring integration 入站适配器跳过消息,spring-integration,Spring Integration,这就是我的配置 <int-file:inbound-channel-adapter id="files" directory="${lz.dir.${ft}}"> <int:poller fixed-delay="3000" max-messages-per-poll="3" /> </int-file:inbound-channel-adapter> <int:bridge input-channel="files" output-chan

这就是我的配置

<int-file:inbound-channel-adapter id="files" directory="${lz.dir.${ft}}">
    <int:poller fixed-delay="3000" max-messages-per-poll="3"  />
</int-file:inbound-channel-adapter>

<int:bridge input-channel="files" output-channel="sourceFiles" />

<int:channel id="sourceFiles">
    <int:dispatcher task-executor="executor" />
</int:channel>

<int:service-activator  input-channel="sourceFiles" 
                        ref="moveToSource" 
                        method="move" />

<int:aggregator id="filesBuffered" 
                input-channel="sourceFiles"
                output-channel="stagedFiles"
                release-strategy-expression="size() == 10" 
                correlation-strategy-expression="'mes-group'" 
                expire-groups-upon-completion="true" 
                />

<int:channel id="stagedFiles" />

<int:service-activator  input-channel="stagedFiles"
                        ref="moveToStage"   
                        method="move" />

<task:executor id="executor" pool-size="5" queue-capacity="0" rejection-policy="CALLER_RUNS" />

其思想是每3秒钟轮询一个目录,并根据通道向调度器发出每次轮询3条消息,以允许异步执行。然后根据消息数量聚合消息,然后发送到下一个service activator。第一个服务激活器将文件放置在源目录中,第二个服务激活器获取聚合列表以将这些文件移动到临时目录

似乎发生的情况是,源文件夹跳过了一些文件,但临时文件夹确实获取了所有文件。我猜轮询器会将消息发送到dispatcher通道,但当其线程池满时,它会忽略文件,但聚合器仍会以某种方式获取所有文件。几乎就像dispatcher channel在线程池限制达到后跳过它接收的文件的第一个service activator步骤,但是这些文件仍然被传递到下一个通道,这就是它们仍然被第二个service activator处理的方式

我想做的是让轮询器重新发送被调度程序拒绝的文件。任何想法都将不胜感激


谢谢

对不起,我不明白您描述的内容,但根据您的配置,它看起来像:

  • sourceFiles
    频道是点对点的。因此,一次只有一个订户可以从该通道获取消息
  • 但您有两个订户—服务激活器和聚合器
  • 默认情况下,
    dispatcher
    使用
    RoundRobinLoadBalancing策略
    。这意味着,第一条消息将由第一个订户处理,第二条消息将由第二个订户处理,以此类推,就像中继一样
  • 因此,如果您想拥有一个顺序,则需要将聚合器订阅到
    moveToSource
    service activator的出站通道,并从
    move
    方法返回相同的负载。在您的情况下,
    文件
  • 如果不是您的情况,请提供正确的配置或解释您的用例。 现在很混乱,对不起