Understanding the SFTP Target Connector

The SFTP target connector enables the gateway to use SFTP to send messages to and receive messages from SFTP servers. It uses the PUT command to place messages or files from the integration gateway onto remote SFTP servers. The GET command is used to receive messages from SFTP servers.

Target Connector Processing

The SFTP Target connector does not directly connect to SFTP servers. The connector loops back into the application server and invokes a PeopleCode application class. This application class uses the GetAttachment and PutAttachment PeopleCode functions to make the connection to the target system. At runtime, the integration gateway logs show the details of the message transfer between the application server and the integration gateway, but does not show the details of the actual connection to the SFTP server.

Base64 Encoding

The SFTP target connector features a node - level property BASE64ENCODE to specify if Base64 encoding is required for PUT requests and present for GET requests.

The following table describes the impact of this property on PUT and GET requests.

Base64 Encoding Description

Y (Default.)

Base64 encoding is required for PUT requests and is present on GET requests.

  • Put Requests.

    The message body is encoded before the system sends the request from the integration gateway to the application server. The application server then decodes the request before sending it to the SFTP server.

  • GET Requests.

    The application server Base64 - encodes the data before passing it to the integration gateway. The integration gateway then decodes the response message.

N

The gateway will not Base64–encode requests or Base64–decode responses. It is the responsibility of the developer to do both.

By default the property is set to Y.

Most users will have no need to modify this property. This property exists to allow binary data to be passed through the connector.

When you set this property to N, you can Base64 - encode binary data and pass that string to the connector for a PUT request. Since the property is N,, and the input string is already Base64 - encode, the integration gateway has no need to perform the encoding again. The input string is then sent to the application server, which Base64 – decodes all requests being sent to the SFTP server.

Conversely, in the case of a GET request, the application server Base64 - encodes all data pulled from the SFTP server. This encoded string is then passed to the integration gateway, which decides whether to decode or not based on the value of this property. If the property is set to N the string is not decoded, and the system allows it to pass through as-is. You can then take the Base64 string and process it as needed.

See the PeopleCode API Reference: File Class Methods product documentation for information about the GetBase64StringFromBinary and WriteBase64StringToBinary methods.

Performance Considerations

The SFTP target connector allows SFTP functionality to be available in the integration gateway using the standard target connector pattern. However, because the SFTP target connector is effectively a wrapper around PeopleCode built-in functions, there is an associated impact on performance.

In certain scenarios this inefficiency may be deemed unacceptable; in those cases call the GetAttachment and PutAttachment functions directly and bypass the integration broker entirely.

Since the gateway calls back into the application server, at least two application server processes are involved in each SFTP invocation. Please ensure that the application server is configured with the appropriate number of processes. Failure to do so may result in SFTP requests being blocked when the gateway attempts to call back into the application server.