File Mule文件传输不删除源文件

File Mule文件传输不删除源文件,file,transfer,mule,File,Transfer,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}"

我正在使用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>


我找不到这个问题的根本原因。提前感谢。

您的文件端点缺少轮询频率属性,这意味着它使用默认值1000ms。这使得Mule轮询文件的处理速度远远快于FTP端点。例如:

pollingFrequency="10000"
如果这还不够好,因为FTP上载具有不可预测的性能(因此Mule仍会重试正在上载的文件),那么如果您的文件足够小,无法放入内存,请尝试添加:

<object-to-byte-array-transformer />


在入站和出站端点之间。这会将文件加载到内存中,并在尝试FTP上载之前将其立即移动到outbound.input.backup.path。当然,如果FTP上载失败,您必须将文件移回outbound.input.path…

请共享您使用的配置(显示文件连接器配置以及文件入站和出站端点的流)。另外:确认Mule有权从源目录中删除。我的配置文件添加了pollingFrequency属性,解决了这个问题。同时,我将尝试使用最佳方式处理它。谢谢你,大卫。