I have a the following (ordinary) sftp inpbound adapter definition:
Here I used a composite filter, where one of the filter's goal is to sorts the files in a business-specific order. Expected behaviour for the xml declaration above is that it should download and forward the eligible files in sorted order (expressed in terms of the filter-logic).Code:<int-sftp:inbound-channel-adapter local-directory="${sftp.localDir}" channel="sdml.in" session-factory="cachedSftpSessionFactory" remote-directory="${sftp.remoteDir}" delete-remote-files="true" filter="compositFilter"> <int:poller fixed-rate="${sftp.pollingRate}" max-messages-per-poll="-1" task-executor="pool"> <int:advice-chain> <ref bean="sysStateInspectingInterceptor" /> </int:advice-chain> </int:poller> </int-sftp:inbound-channel-adapter>
I find that this is not the case; filtering is ok, download order is still ok, but Messages generated by the adapter are inordered!
Looking at the source I've found the following:
SFTP message source - and generally all MessageSource<File> implementation extending AbstractInboundFileSynchronizingMessageSource must exhibit this behaviour. I guess the reason is that AbstractInboundFileSynchronizingMessageSource instantiates a FileReadingmessageSource in order to handle the downloaded files.
I - as an SI user - dont have any possibilities to configure this fileSource instance! This is the couse of the problem.
Regarding this issue https://jira.springsource.org/browse/INT-1857, processing order of a FileReadingMessageSource can be influenced by a Comparator<File> of the queue, what can be nicely configured via a <int-file:inbound-channel-adapter> (as a comparator attribute), but not in a <int-sftp:inbound-channel-adapter>!
Please give me some hints, workaround, how could i achive ordered processing of the downloaded files?
thanks,
Gabor


Reply With Quote
and hat is what we are trying to fix
