From 40f652e60f610b80cbd0223092e360ac22c1e2d0 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Thu, 16 Dec 2010 15:12:55 -0500 Subject: [PATCH] polish doc --- docs/src/reference/docbook/ftp.xml | 47 ++++++++++++++++-------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/docs/src/reference/docbook/ftp.xml b/docs/src/reference/docbook/ftp.xml index 37c1562ca4..0d4393d16b 100644 --- a/docs/src/reference/docbook/ftp.xml +++ b/docs/src/reference/docbook/ftp.xml @@ -163,34 +163,37 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/ftp ]]> - Poller configuration notes for FTP Inbound adapter + Poller configuration notes for the inbound FTP adapter - The job of protocol specific adapters such as FTP consists of two tasks. - 1) Communicate with remote server and transfer file from the remote directory to the local directory - 2) Generate Message with the transferred file as a payload and send it to a channel identified via 'channel' attribute. + The job of the inbound FTP adapter consists of two tasks: + 1) Communicate with a remote server in order to transfer files from a remote directory to a local directory. + 2) For each transferred file, generate a Message with that file as a payload and send it to the channel identified by the 'channel' attribute. - That is why they called 'channel-adapters' not just 'adapters' and therefore the main job of such adapter is to generate a - Message which essentially makes the second part of the above explanation to take precedence in such way that - *IF* your local directory already has a file(s) it will first generate Messages from these files and *ONLY* - when all files have been processed it will initiate the remote communication to get more files. - - So when configuring a trigger on the poller you might want to pay an extra attention to max-messages-per-poll - attribute which has a default value of 1 for all SourcePollingChannelAdapter instances (e.g., FTP). - This means that as soon as one file is processed it will wait for the next execution time which is dependent on your - trigger configuration, so if you happened to have a file(s) sitting in the local-directory it would process - those files before it would initiate communication with remote FTP server and if the max-messages-per-poll - was set to 1 (default) then it would be processing one file at the time with intervals defined by your trigger + That is why they are called 'channel-adapters' rather than just 'adapters'. The main job of such an adapter is to generate a + Message to be sent to a Message Channel. Essentially, the second task mentioned above takes precedence in such a way that + *IF* your local directory already has one or more files it will first generate Messages from those, and *ONLY* + when all local files have been processed, will it initiate the remote communication to retrieve more files. + + + Also, when configuring a trigger on the poller you should pay close attention to the max-messages-per-poll + attribute. Its default value is 1 for all SourcePollingChannelAdapter instances (including FTP). + This means that as soon as one file is processed, it will wait for the next execution time as determined by your + trigger configuration. If you happened to have one or more files sitting in the local-directory, it would process + those files before it would initiate communication with the remote FTP server. And, if the max-messages-per-poll + were set to 1 (default), then it would be processing only one file at a time with intervals as defined by your trigger, essentially working as one-poll = one-file. - For typical use cases you most likely want the oposite behavior and that is to process all the files you can for each - poll and only then wait for the next poll. If that is the case it is recommended to set max-messages-per-poll to -1 - value which means on each poll the adapter will attempt to generate as many messages as it possibly can meaning it will process - everything in the local directory, then it will connect to the remote directory transferring everything that is available - there and processing them locally. Only then the poll will stop and wait for the next execution time - - You can also set it to some value greater then 1 (e.g., 10 which means on each poll attempt to process no more then 10 files) + For typical file-transfer use cases, you most likely want the opposite behavior: to process all the files you can for each + poll and only then wait for the next poll. If that is the case, set max-messages-per-poll to -1. Then, on + each poll, the adapter will attempt to generate as many Messages as it possibly can. In other words, it will process + everything in the local directory, and then it will connect to the remote directory to transfer everything that is available + there to be processed locally. Only then is the poll operation considered complete, and the poller will wait for the next execution time. + + + You can alternatively set the 'max-messages-per-poll' value to a positive value indicating the upward limit of Messages to be created + from files with each poll. For example, a value of 10 means that on each poll it will attempt to process no more than 10 files.