Mule file transfer not deleting source files

I am using Mule 3.2 and I am moving files from one place to another. The error / problem is that Mule continues to process the same files over and over and does not delete them.

The console displays:

org.mule.transport.file.FileMessageReceiver: Lock obtained on file: 

My configuration 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 of this problem. Thanks in advance.

+4
source share
1 answer

The endpoint of your file skips the pollingFrequency attributes, which means that it uses a default value of 1000 ms. This makes Mule survey files faster than the FTP endpoint can process them. Try for example:

 pollingFrequency="10000" 

If this is not enough, because FTP upload has unpredictable characteristics (therefore Mule still repeats the upload file), then if your files are small enough to fit into memory, try adding:

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

between your inbound and outbound endpoint. This loads the file into memory and moves it straight to outbound.input.backup.path before attempting to upload FTP. Of course, if the FTP download failed, you will have to move the file back to outbound.input.path ...

+3
source

Source: https://habr.com/ru/post/1386571/


All Articles