spring - int-ftp:inbound-channel-adapter fetch in sequential order? -
how can make int-ftp:inbound-channel-adapter fetch files in order created on remote system ?
for example :
file1 - 15:31:01 file2 - 15:32:02 file3 - 15:33:03 file4 - 15:34:04 file5 - 15:35:05
assume application down 5 minutes, in time 5 files got created, once restart/redeploy application, int-ftp:inbound-channel-adapter has fetch files local system in order created(timestamp).
please suggests.
regards, ravi
the <int-ftp:inbound-channel-adapter>
has comparator
attribute:
<xsd:attribute name="comparator" type="xsd:string"> <xsd:annotation> <xsd:documentation><![cdata[ specify comparator used when ordering files. if none provided, order determined java.io.file implementation of comparable. ]]></xsd:documentation> </xsd:annotation> </xsd:attribute>
it used internal queue
:
public filereadingmessagesource(comparator<file> receptionordercomparator) { this.tobereceived = new priorityblockingqueue<file>( default_internal_queue_capacity, receptionordercomparator); }
after ftpinboundfilesynchronizer
pulls remote files local dir before poller starts pick them message flow.
Comments
Post a Comment