mule 4 sftp文件读取后删除文件,读取文件
使用Mule 4.4社区版。 我正在使用Mule的SFTP连接器读取文件:
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-sftp-connector</artifactId>
<version>1.4.1</version>
<classifier>mule-plugin</classifier>
</dependency>
在Dedug模式下运行代码,在读取文件后,我仍然可以在SFTP位置(很好)上查看该文件,但是在文件读取后它消失了。...(请参阅下文代码)
<sftp:config name="SFTP_Config" doc:name="SFTP Config"
timeBetweenSizeCheck="30" timeBetweenSizeCheckUnit="SECONDS">
<sftp:connection host="myHost" port="22" username="myUser" password="myPassword" />
</sftp:config>
<until-successful maxRetries="1" doc:name="Until Successful" millisBetweenRetries="30000">
<sftp:read doc:name="Read employee file" config-ref="SFTP_Config" path="${sftp.inputDir}\employee.unl" timeBetweenSizeCheck="-1" outputMimeType="application/csv; streaming=true; header=false; separator=|" outputEncoding="UTF-8">
<non-repeatable-stream />
</sftp:read>
</until-successful>
<choice doc:name="is the file empty ?" >
<when expression="sizeOf(payload) == 0">
<raise-error doc:name="Raise error on empty file " type="FILE_NOT_PRESENT_OR_EMPTY" description="Employee File empty "/>
</when>
<otherwise >
<logger level="INFO" doc:name="Payload not empty" message=" #[sizeOf(payload)]" category="employee"/>
</otherwise>
</choice>
因此,当代码输入选择条件时,我可以看到该文件在SFTP驱动器上不再可用...
我已经在调试模式下测试了此代码,以验证文件何时删除 /消失。
不知道为什么会发生这种情况?
为什么在代码进入选择条件后,文件被删除?
Using Mule 4.4 community edition .
I am reading a file using mule's sftp connector :
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-sftp-connector</artifactId>
<version>1.4.1</version>
<classifier>mule-plugin</classifier>
</dependency>
Running code in dedug mode , after the file is read , I can still see the file on sftp location ( which is good ) , however it disappears after file read .... ( see below code )
<sftp:config name="SFTP_Config" doc:name="SFTP Config"
timeBetweenSizeCheck="30" timeBetweenSizeCheckUnit="SECONDS">
<sftp:connection host="myHost" port="22" username="myUser" password="myPassword" />
</sftp:config>
<until-successful maxRetries="1" doc:name="Until Successful" millisBetweenRetries="30000">
<sftp:read doc:name="Read employee file" config-ref="SFTP_Config" path="${sftp.inputDir}\employee.unl" timeBetweenSizeCheck="-1" outputMimeType="application/csv; streaming=true; header=false; separator=|" outputEncoding="UTF-8">
<non-repeatable-stream />
</sftp:read>
</until-successful>
<choice doc:name="is the file empty ?" >
<when expression="sizeOf(payload) == 0">
<raise-error doc:name="Raise error on empty file " type="FILE_NOT_PRESENT_OR_EMPTY" description="Employee File empty "/>
</when>
<otherwise >
<logger level="INFO" doc:name="Payload not empty" message=" #[sizeOf(payload)]" category="employee"/>
</otherwise>
</choice>
So when the code enters the choice condition I can see the file is somehow no longer available on SFTP drive ...
I have tested this code in debug mode to verify when the file is getting deleted / disappearing.
Not sure why this would happen ?
why is the file getting deleted after code enters into the choice condition ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论