sftp egress connector

SFTP Egress Connector

Version: 17.01

Supported Since: 17.01

What is SFTP Egress Connector?

The SFTP Egress Connector can be used to send messages to a remote SFTP server and same as the inject connectors, UltraESB framework can communicate with almost all the SFTP servers which implements the generic SFTP protocol.

When you are sending a message to a SFTP server, UltraESB server expects the file content as the message payload and file name as a variable.

The sample use cases below depict an integration flow with SFTP egress connector.

Sample Use Case

Use case description

In this use case scenario, requirement is to poll the files from a local directory and send all the JSON files in the local directory to a SFTP server. For statistics and monitoring purposes it’s required to extract out the client ID’s from the input file and create a log specifying the extracted client ID value and sending file name name should be prefixed by the extracted client ID value.

Prerequisite

In order to implement above use case you must first select the SFTP Connector and Local File Connector dependencies from the connector list when you are creating an empty Ultra project. If you have already created a project, you can add these dependencies via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Connectors list and Processors list, select above dependencies

Implementation

To implement above use case, first let’s create our integration flow named “integrate-to-send-via-sftp” and first add the File Listener IngressConnector and configure input file receiving path and file name patterns to fetch input JSON files from the local directory.

Next processing element should be the JSON Path Extractor to extract out the Client ID from the received JSON message. JSON path of the client id should be configured as the JSON path parameter of this processing element. This processing element will extract out the parameter from the JSON message and save it as a variable with the name given in it’s Variable Name parameter.

After that, Logger processing element should be added to log the input file name and the respective client ID based on the value stored in the variable by the JSON path extractor.

Finally SFTP EgressConnector element should be added to the integration flow to send the file to the SFTP server as per the requirement use case. SFTP EgressConnector can be configured by filling the Basic properties as below,

sftp egress connector 1

After filling out the required parameters, this configuration can be saved by clicking the Save button at the bottom of each element.

With all above elements, complete integration flow would be like this,

sftp egress connector 2

File Name parameter is configured with "@{message.var.CLIENT_ID}_@{message.header.ultra.file.name}" to modify the file name by attaching the client ID as the suffix for the original file name. Framework will replaced the "@{message.var.CLIENT_ID}" from the value of the variable with name CLIENT_ID and "@{message.header.ultra.file.name}" will be replaced by the value of the transport header with name "ultra.file.name" which is the original file name received via File IngressConnector.

Now if you run the flow, and put an JSON file to with name ends with "_Adroitlogic.json", to the configured local folder that file should be send to the configured SFTP server and file name should be prefixed with the Client ID of the input message

Out Ports

On Exception

The message will be sent to this out port if the processing element failed to upload the given file to the configured SFTP location

Parameters

* marked fields are mandatory

Host Name *

Basic

Host name/IP of the SFTP server that you are going to send files

Port *

Basic

Port of the SFTP server that you are going to send the files. By default value of this will be set to 22

Username *

Basic

Username that you are going to use to connect to the SFTP server

Password

Basic

Password for above user name if you are going to connect via password based authentication to the SFTP server

File Path *

Basic

Path of the SFTP server that you are going to send files. This path should be relative to the home directory of the above given user

File Name

Basic

File name to be used while sending files to SFTP server. If this is empty, framework will expect this as transport header with name "ultra.file.name". Optionally user can configure this file name based on either Variable, Transport Header or message properties which can be set dynamically.

Append Mode

Basic

If this is enabled, the framework will append the current message payload if there is a file with same name in the given location. If this is disabled, existing file will be replaced by the new file at the SFTP server sending path

Key File Path

Key Authentication

Path of the private key of the user which will be used to communicate with SFTP server via key based authentication.

Key Password

Key Authentication

Password of the private key if it’s password protected.

Host Key Check

Key Authentication

Set to enable the host key checking while creating the communication channel with SFTP server. If this is not enabled, host key checking will be skipped while SFTP processing. By default, this will be false.

Weight

Fail-Over

Weight for the Egress Connector if this Egress Connector is under a weighted Egress Load Balancer

Max Connections

Advanced

Maximum number of connections which will be cached within the SFTP EgressConnector for the configured SFTP server. By default, this value is 10.

Timeout *

Advanced

Timeout in millis, to be used while connecting to the remote SFTP server. If it couldn’t establish a connection with the SFTP server within this time period, it will be considered as a connection failure and notify to the user. By default, this value is 60000.

Egress Timeout

Advanced

Timeout value in milliseconds for the egress message

In this topic
In this topic
Contact Us