The (S)FTP Client communication point is used to connect to an FTP Server to retrieve files from an input directory, or send messages to an output directory, or both. It supports the following transfer protocols:
- FTP
- FTPS (FTP over SSL)
- SFTP (FTP over SSH)
The communication point can be configured statically or dynamically at runtime. The communication point also provides some multiple connection management.
Configuration Properties
The following table lists the configuration properties for the (S)FTP Client communication point. As there are many different FTP servers that have different configuration options, there may be properties that are not applicable for the FTP to which you are connecting.
The (S)FTP Client communication point supports Input, Output and Out->In Modes only.
Managing Multiple Connections
Do not configure multiple (S)FTP Client communication points to access the the same file in an input directory in order to avoid race conditions that could occur when they simultaneously attempt to read that file.
Because it is possible to use multiple connections to a single server from the same communication point instance, the communication point co-ordinates upload and download activities on a per-server basis. If the communication point detects multiple connections are being made to the same server, it coordinates the connections to ensure they are not trying to do the same thing at the same time. Two connections are considered to be the same if they are connecting to the same server name, on the same port, with the same username.
In Output mode, if the communication point detects that multiple connections are being made to the same server, it coordinates the connections to ensure they are not trying to upload a file with the same name to the same directory path at the same time. If this is detected, the second or subsequent connection blocks until the first connection has finished its upload.
In Input mode, if the communication point detects that multiple connections are being made to the same server, it coordinates the connections to ensure they are downloading different files. This means the second or subsequent connection instead gets the next available file, or reports that there were no more available files if the first connection is already getting the last available file.
The blacklist of files which cannot be deleted or have already been processed (when deletion is disabled) must be shared between multiple connections to the same server. The files remain on the blacklist until:
- The number of connections with blacklisted files in the controller reaches the maximum (by default, 20 connections), in which case blacklisted files in the least-recently-used connection are removed.
- When the connection is idle for a period of time (by default, five minutes).
If the default settings are not suitable, the following properties can be added to the rhapsody.properties
file to handle inactive connections:
Property | Description |
---|---|
FileTransferModule.MaximumInactiveConnectionMetaData |
Sets the maximum connection count before the controller attempts to discard the oldest inactive connection. By default, it is 20, but can be set to any value between 5 and 1000. If it is set out of the valid range, then it uses the appropriate minimum or maximum value. |
FileTransferModule.ConnectionMetaDataIdleTimeoutMinutes |
Sets the idle timeout for inactive connections. By default, it is 5 minutes, but can be set to any value between 1 and 1440 minutes. If it is set to a value outside of this range, it uses the appropriate minimum or maximum value. |
Published Properties
Published properties for the (S)FTP Client communication point are:
FullFilename
- the full filename of the file associated with the received message.BaseFilename
- the base filename (that is everything before the last '.
' in the full filename) of the file associated with the received message. If there is no '.
', then it is equal to the full filename.Suffix
- the suffix (everything from the last '.
' in the full filename, including the '.
') of the file associated with the received message. If there is no '.
', then it is empty.InputDirectory
- the directory path that the file associated with the received message was retrieved from.sftp:BodySize
- indicates the size of the file, in bytes, when it is received by the (S)FTP Client communication point (a value ofUnknown
indicates file size retrieval has failed). This property is not updated when the size of the file changes as the file is processed on the route.sftp:ReplyCode
- an FTP server reply code. Refer to Advanced Routing for details.