1
我使用彈簧整合FileSplitter並對有序處理文件使用FileMarker-s,但對於空文件,我得到IOException。如果沒有文件標記,一切都正常工作用於空文件的彈簧整合文件標記
堆棧跟蹤:
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>
創建問題https://jira.spring.io/browse/INT-4067 –