Spring 集成 - 入站通道适配器在读取新文件时再次发送最后一个文件

Spring Integration - Inbount Channel Adapter sends last file again when it reads a new file

入站通道适配器从输入目录读取第二个文件时出现问题。适配器开始这样的流程:Adapter -> channel -> Splitter -> Channel... -> Database.

Splitter 逐行读取文件进程,然后将文件复制到另一个目录并删除原始文件。

问题是,适配器按预期方式处理第一个文件,但是当它读取第二个文件时,它再次从第一个文件发送消息(第一个文件不再位于输入目录中)。

注意:第一个通道与 ActiveMQ 队列保持一致。确认本地。

配置:

<int-file:inbound-channel-adapter id="filesIn" channel="reinjectionChannel" filename-regex="reinyeccion[0-9]{8}.txt"
    directory="${input.directory.reinyeccion}" prevent-duplicates="true" />

<jms:channel id="reinjectionChannel" queue="reinjectionChannelQueue">
    <jms:interceptors>
        <int:wire-tap channel="reinjectionLoggingChannel"/>
    </jms:interceptors>
</jms:channel>

<int:splitter input-channel="reinjectionChannel" method="split" 
    output-channel="inputChannel" ref="reinjectionSplitterBean" />

<int:channel id="inputChannel" >
    <int:interceptors>
        <int:wire-tap channel="inputLoggingChannel"/>
    </int:interceptors>
</int:channel>

日志:

org.springframework.integration.handler.LoggingHandler   handleMessageInternal  INFO  (BBR) reinjectionLoggingChannel \tmp\concentrador\files\input\reinyeccion20151109.txt
org.springframework.integration.handler.LoggingHandler   handleMessageInternal  INFO  (BBR) reinjectionLoggingChannel \tmp\concentrador\files\input\reinyeccion20151108.txt

感谢您的帮助。

我找到了,我需要清除拆分器返回的消息列表。