My use case is to poll a local directory for a list of new files periodically, and then upload them to a FTP server in 1 connection. The Camel route is defined in Spring XML as follows:
<route>
<from uri="file:data/inbox?noop=true&delay=1000&maxMessagesPerPoll=3" />
<to uri="ftp:uid:xxxxx@host:21/data?disconnect=false"/>
</route>
The route is functioning well, except that the FTP connection will retain connected until the FTP server timeout my connection. I hope to reuse the same connection to upload a batch of files and then close the connection immediately when the last file in the batch completed the upload. How can achieve this in Camel?