Spring文件的Spring integeration文件标记

时间:2016-07-06 09:37:23

标签: java spring spring-integration

我使用Spring-integration FileSplitter并使用FileMarker-s作为有序处理文件,但对于空文件,我得到IOException。没有FileMarker-s一切正常

堆栈跟踪:

Caused by: java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:122)
at java.io.BufferedReader.readLine(BufferedReader.java:317)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at org.springframework.integration.file.splitter.FileSplitter$1.hasNext(FileSplitter.java:183)
... 50 more

XML的配置:

<int:chain input-channel="channel.read.file" output-channel="channel.process.input">
    <int-file:splitter markers="true"/>
    <int:filter expression="!(payload instanceof T(org.springframework.integration.file.splitter.FileSplitter.FileMarker))"
            discard-channel="channel.process.file.marker"/>
</int:chain>

1 个答案:

答案 0 :(得分:0)

对我来说听起来像个错误 - 请打开JIRA Issue