5

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.

David Dossot
  • 33,403
  • 4
  • 38
  • 72
Palani
  • 1,891
  • 7
  • 31
  • 42
  • Please share the configuration you use (show the File connector configuration and the flow(s) with the File inbound and outbound endpoints). Also: confirm Mule has rights to delete from the source directory. – David Dossot Dec 15 '11 at 17:55
  • My config file – Palani Dec 15 '11 at 18:00

1 Answers1

3

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:

pollingFrequency="10000"

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:

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

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...

David Dossot
  • 33,403
  • 4
  • 38
  • 72
  • adding pollingFrequency attribute solves the problem.Also i will try to handle it in best way using . Thanks David. – Palani Dec 15 '11 at 19:20