java-8spring-integrationspring-integration-dslspring-integration-ftp

Spring Integration DSL FTP Issue


I have dynamic spring integration flow

FTP -> downloads the files and put in the directory "C:\testing" Transformer will move the files to "XYZ" directory

SFTP -> downloads the files and put in the directory "C:\testing" Transformer will move the files to "XYZ" directory

Now what I see for example FTP has downloaded the file and before while transformer is moving the file SFTP Polls happens

SFTP see the file in "C:\testing" directory so it also process the message and obviously throws the exception since file was moved

Now is it the requirement to have different loca directory to each flow?

If there is any other way


Solution

  • Now is it the requirement to have different loca directory to each flow?

    That's correct because those polling channel adapters knows nothing about each other and just take a content of the dir for their logic.

    So, to make everything working well, you indeed has to have individual local dirs for everything polling remote file channel adapter. There is just no any correlation between channel adapter and those local files.