Configuring a SFTP Connection Cache Service

Reference:

The SFTP Connection Cache service caches a single SFTP connection (both the control and data channels) to an SFTP server. When the connection cache is started, an existing connection from the cache is utilized for any SFTP agent, within the iSM process flow that connects to an SFTP server, with the same address and authentication credentials (user ID and password).

The SFTP connection cache that has been configured to start caching will create a cache if it does not already exist, and pre-populate it with a connection. Other SFTP agents will use this cache if it exists. Specifically, that means retries request new connections from the connection pool, and the connection is returned to the cache when the agent completes its execution.

To configure a SFTP Connection Cache service:

  1. Perform the steps as described in Configuring Services.
  2. Ensure that you select SFTP Connection Cache {com.ibi.agents.XDSFTPConnectionCacheAgent} as the service type you are configuring.

    For a complete description of the configuration parameters that are available for the SFTP Connection Cache service, see Secure FTP Connection Cache Service Parameters.

Reference: SFTP Connection Cache Service Parameters

The following table lists and describes parameters for the SFTP Connection Cache service.

Parameter

Description

Configuration parameters for SFTP Connection Cache service

Host Name (required)

The DNS name (or IP address) of the SFTP server that you want to connect to.

Remote Port (required)

The port to connect to on the SFTP site. Leave it blank for default port 22.

Buffer Size

Size of the SFTP buffer to be used when sending or retrieving data. The default value of 32768 is used if this field is not set. A larger buffer may improve performance, but setting this field to a value greater than 65536 will default to 65536. The value must be entered as a whole number (for example, 32768 or 65536). iWay recommends leaving the buffer size set to 32768.

SSH Parameters

User Name

A valid user ID for the SFTP server.

Password

A valid password for the SFTP server.

Private Key

Path to the private key file for public key authentication.

Passphrase

Passphrase used to protect the private key.

Provider

Name of the SSH Client Security Provider to use. If no provider name is specified, then enter the user ID and either a password or a private key and passphrase values. Passphrase is required only if the private key file is protected by a passphrase.

Agent Parameters

Connection Caching (required)

Select start to cache the connection referenced by this service. Select stop to close the cached connection. Select one of the following options from the drop-down list:

  • start. Starts the caching connection on this thread.
  • stop. Stops the connection caching on this thread and closes the active connection.

Reference: SFTP Connection Cache Service Example

The following is a sample process flow for the SFTP Connection Cache service.

iSM Object

Description

Start

Start of process flow.

Start Cache

Calls the XDSFTPConnectionCacheAgent for the server to connect to.

FTP Directory

XDSFTPDirListAgent uses the connection that was created in Start Cache to create a document containing the files within a directory.

Iterator

Loops through the document returned by FTP Directory using the expression /dir/item to retrieve each entry in the document.

XDSREGAgent

Creates Special Registers with the File name and Directory extracted via XPATH from the document segment created by the Iterator.

FTP Read

XDSFTPReadAgent uses the connection that was created in Start Cache to read the file from the directory.

wait 15 seconds

Uses the XDCopyAgent to delay processing for 15 seconds simulates processing that may occur.

Loop

Loops back to the Iterator to get next file value.

ERROR

If the XDSFTPReadAgent is unsuccessful, the FTP Read exits ($error, $fail, etc…).

EXIT

Called after either the ERROR, or loop completes.

Stop Cache

Calls the XDSFTPConnectionCacheAgent to close the connection to the server.

End

Terminates the process flow.