我正在尝试将csv
文件复制到本地目录,然后解析SftpInputStream
. 文件被正确复制。但是,虽然我在文件连接器中设置streaming
为false
,但似乎file inbound-endpoint
关闭了流,因此我的转换器无法解析流。
如何防止在复制文件后file:outbound-endpoint
关闭?stream
这些是我的连接器:
<sftp:connector name="mySftpConnector" pollingFrequency="1000" autoDelete="true" />
<file:connector name="myFileOutputConnector" streaming="false" outputPattern="#[header:originalFilename]" />
这是我的流程:
<flow name="myFlow" processingStrategy="synchronous">
<sftp:inbound-endpoint
address="xxx"
connector-ref="mySftpConnector" autoDelete="false">
<file:filename-wildcard-filter pattern="*.csv"/>
</sftp:inbound-endpoint>
<file:outbound-endpoint path="/archive" connector-ref="myFileOutputConnector" />
<transformer ref="mySftpTransformer" />
<component>
<spring-object bean="mySftpHandler" />
</component>
</flow>
抛出的异常是:
java.io.IOException: Stream closed
at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
at java.io.BufferedInputStream.read(BufferedInputStream.java:308)
at org.mule.transport.sftp.SftpInputStream.read(SftpInputStream.java:90)
...