Mule 文件传输不删除源文件
我正在使用 Mule 3.2,并将文件从一个位置移动到另一个位置。错误/问题是 Mule 不断地一次又一次地处理相同的文件并且不删除它们。
控制台显示:
org.mule.transport.file.FileMessageReceiver: Lock obtained on file:
我的配置文件如下:
<flow name="File-FTP-Bridge">
<file:inbound-endpoint path="${outbound.input.path}"
moveToDirectory="${outbound.input.backup.path}">
<file:filename-wildcard-filter
pattern="*.msg" />
</file:inbound-endpoint>
<ftp:outbound-endpoint user="${outbound.ftp.user}"
password="${outbound.ftp.password}" host="${outbound.ftp.host}"
path="${outbound.ftp.path}" port="${outbound.ftp.port}"
outputPattern="#[header:originalFilename]">
</ftp:outbound-endpoint>
</flow>
我找不到此问题的根本原因。提前致谢。
I am using Mule 3.2 and I am moving files from one location to another location. The error/problem is that Mule keeps on processing the same files again and again and do not deleted them.
The console displays:
org.mule.transport.file.FileMessageReceiver: Lock obtained on file:
My config file is below:
<flow name="File-FTP-Bridge">
<file:inbound-endpoint path="${outbound.input.path}"
moveToDirectory="${outbound.input.backup.path}">
<file:filename-wildcard-filter
pattern="*.msg" />
</file:inbound-endpoint>
<ftp:outbound-endpoint user="${outbound.ftp.user}"
password="${outbound.ftp.password}" host="${outbound.ftp.host}"
path="${outbound.ftp.path}" port="${outbound.ftp.port}"
outputPattern="#[header:originalFilename]">
</ftp:outbound-endpoint>
</flow>
I could not find the root cause for this problem. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的文件端点缺少 pollingFrequency 属性,这意味着它使用默认值 1000 毫秒。这使得 Mule 轮询文件的速度比 FTP 端点处理它们的速度要快。举个例子:
如果这还不够好,因为 FTP 上传具有不可预测的性能(因此 Mule 仍然会重试正在上传的文件),那么如果您的文件足够小以适合内存,请尝试添加:
在入站和出站端点之间。这会在尝试 FTP 上传之前将文件加载到内存中并将其立即移动到 outbound.input.backup.path。当然,如果FTP上传失败,你就必须将文件移回outbound.input.path...
Your file endpoint misses a pollingFrequency attributes, which means it uses the default of 1000ms. This makes Mule poll files way faster than the FTP endpoint can process them. Try for example:
If this is not good enough because the FTP upload has unpredictable performances (so Mule still retries a file that is being uploaded), then if your files are small enough to fit in memory, try adding:
between your inbound and outbound endpoint. This loads the file in-memory and moves it right away to outbound.input.backup.path, before trying the FTP upload. Of course, if the FTP upload fails, you'll have to move the file back to outbound.input.path...