1
votes

i have a problem with an inbound channel adapter when it reads a second file from the input directory. The adapter starts a flow like this: Adapter -> channel -> Splitter -> Channel... -> Database.

The Splitter reads the file process each line and then it copy the file to another directory and deletes the original file.

The thing is, the adapter is working as expected with the first file, but when it reads a second file it sends the messages from the first file again (The first file is not in the input directory anymore).

Note: the first channel persists with an ActiveMQ queue. Ack local.

Config:

<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>

Logs:

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

Thanks for your help.

1

1 Answers

0
votes

I found it, i needed to clear the list of messages returned by the splitter.