Announcement Announcement Module
No announcement yet.
How does prevent-duplicates work? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How does prevent-duplicates work?

    <file:inbound-channel-adapter id="filesInput"
    channel="inputFilesChannel" directory="file:/temp/spring-integration-samples/input"
    filename-pattern="*.tiff" prevent-duplicates="true">
    <intoller id="poller1" max-messages-per-poll="1"
    fixed-delay="5000" />
    Hi everyone,

    I'm wondering about prevent-duplicates configuration option; how does it work? How does it determine if a a duplicate has been received; based on file name or something else?

    I'm having a strange problem of files being stuck in the channel, and I'm not sure why. I'm now trying to figure this out, and am looking at the above option among other stuff. Given this, any advice you might have why this would happen, apart from prevent-duplicated option would be welcomed.

    Thank you!

  • #2
    The prevent-duplicates option uses AcceptOnceFileListFilter under the hood, which compares file names to what it has seen before (this is tough on memory if you process a lot of files). There are many reasons why an app might appear stuck, all boiling down to either that it has nothing to do (and is waiting) or that it is busy doing something that takes a long time. To figure out which it is you create a stackdump and analyse.