Spring inbound file channel adapter prevent-duplicates=false not working

841 views Asked by At

I have got a problem with the spring inbound channel adapter. Importing new files works perfectly fine. But the option prevent-duplicates="false" does not seem to work properly - when a file with the same name is saved to the specified directory it is not imported.

The definition of the inbound channel adapter:

  <int-file:inbound-channel-adapter id="incidentExportAdapter"
    directory="file:${incident.export.directory.path}" prevent-duplicates="false"
    channel="incidentExportChannel" filename-regex="GA[0-9]{6}.(0?[0-9]?[0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-7])$" auto-create-directory="true" 
    auto-startup="false" >
    <int:poller default="true" fixed-delay="${incident.export.interaction.polltime}" id="poller" time-unit="MILLISECONDS" max-messages-per-poll="5"></int:poller>

  </int-file:inbound-channel-adapter>

Thanks in advance for any advice! It would be nice if i get some working example as i tried a lot but didn't succeed so far.

1

There are 1 answers

1
Jackie Dong On

The default AcceptOnceFileListFilter does not look at the lastModified file attribute, just the file name, you may need FileSystemPersistentAcceptOnceFileListFilter

See the documentation.