Skip to Content
Technical Articles

Cloud Integration – Dynamically Configure the SFTP Receiver Adapter

This blog describes how to configure the connection and processing settings of the SFTP receiver adapter dynamically to be able to send messages to multiple SFTP servers from one SFTP channel. This feature will be available for customers starting with the 8-June-2020 release. This blog describes the configuration options.

Dynamically Configure the SFTP Receiver Adapter

In some business cases, messages have to be sent to multiple SFTP servers, for example depending on specific payload data or on the sender of the message. Starting with the 8-June-2020 release, you can configure the SFTP adapter in Cloud Integration dynamically. Using this feature you can connect one SFTP receiver channel to more than one SFTP servers.

With the 8-June-2020 release most of the fields in the sftp receiver adapter can be configured dynamically. Some using header or property and some by specifying the value in a pre-defined property.

Fields Configurable with Header or Property

You can configure the entry fields Directory, File Name, Address, Location ID, User Name, Credential Name and Private Key Alias dynamically using header (${header.abc}) or property (${property.abc}) as shown below.

If the header or property is not defined during runtime, an error is thrown.

Dropdowns with Dynamic Option

There are two options, Authentication and Proxy Type, that are to be configured using dropdown lists on the user interface. You can specify these settings dynamically by choosing the option Dynamic from the dropdown (as shown in the screenshot above) and defining the actual value in the respective SAP property.

The SAP properties to be used and the possible values are:

Attribute                         SAP property                    Type            Values

Proxy Type                      SAP_FtpProxyType         String          ‘internet’ and ‘onPremise’

Authentication               SAP_FtpAuthMethod      String         ‘key’, ‘user’ and ‘dual’

If the property is not defined during runtime, an error is thrown.

Fields Configurable using pre-defined SAP Property

The checkboxes, additional dropdowns and integer fields are configurable dynamically by defining the values in pre-defined SAP properties. The following table shows the names of the properties for the different configuration options:

Attribute                                       SAP property                        Type            Values

Timeout                                         SAP_FtpTimeout                   int                 Values of type integer

Max. Reconnect Attempts      SAP_FtpMaxReconnect       int                Values of type integer

Reconnect Delay                         SAP_FtpMaxReconDelay     int                Values of type integer

Automatically Disconnect       SAP_FtpDisconnect               boolean, string      ‘true’, ‘false’

Change Directories Stepwise SAP_FtpStepwise                   boolean, string      ‘true’, ‘false’

Create Directories                       SAP_FtpCreateDir                 boolean, string      ‘true’, ‘false’

Handling for Existing Files        SAP_FtpAfterProc                 String          ‘Overwrite’, ‘Append’, ‘Fail’, ‘Ignore’

Flatten Filenames                          SAP_FtpFlattenFileName   boolean, string        ‘true’, ‘false’

There is no need to define all the configuration options dynamically, I recommend you to do so only if the required settings differ for the different SFTP servers you want to connect to. If the property is not set, the runtime uses the value defined in the channel.

Dynamic Known Hosts File

To be able to establish a secure connection to an SFTP server, the host key of the SFTP server has to be available in a known hosts file in the Cloud Integration tenant. There are two options to store known hosts files in Cloud Integration:

  • You deploy the known hosts file in the tenant in the Security Material monitor. You can store the host keys of multiple SFTP servers in this known hosts file. During the runtime, the SFTP adapter verifies the SFTP host against this known hosts file. If you have a fix list of SFTP servers, you can store the host keys of all the SFTP servers in this single known hosts file. In this case, there is no need to define the known hosts file dynamically in the SFTP adapter.
  • The second option is to store the known hosts file in the Partner Directory. This way, you can specify the known hosts file dynamically in the SFTP adapter. You upload the host key for a specific partner ID in a known hosts file to the Partner Directory and use it from there dynamically during runtime. This would be the recommended option if you wanted to connect to multiple SFTP servers of different partners from one generic integration flow. To do this, define property SAP_FtpPdUri with the URI for the Partner Directory access in the integration flow before calling the SFTP adapter, for example SAP_FtpPdUri=’pd:<PD partner ID>:<Id>:Binary’. Use the Partner Directory APIs to upload the host key of the SFTP server for a specific partner in a known hosts file to the Partner Directory in binary format. Refer to the blog Partner Directory – Partner Dependent XML Structires and IDs for how to use the Partner Directory and how to upload binary data there.

 

4 Comments
You must be Logged on to comment or reply to a post.