Description

The SFTPReceiver automatically sends files to another server via SFTP.


Parameters

The following parameters should be defined for the SFTPReceiver. Items with an asterisk(*) are required.

  • payloadFilesPath* - Defines the base location of the files to send
  • payloadFilesSubDir - Defines the naming convention for subdirectories within the payloadFilesPath
  • payloadFilesDescriptor - Defines the name of the descriptor of files to be sent from payloadFilesSubDir
    • Example: 
      • txt - Sends only files whose extension is txt
      • xls - Sends only files whose extension is xls
  • propertiesFilePath* - Defines the location of the configuration properties file
  • propertiesSubDir - Defines the subdirectory within the propertiesFilePath where the properties file is located
  • propertiesFileName* - Defines the file name of the configuration properties file 
  • logFileCount* - Defines the number of requests that are executed before logging a message to the console
  • threadCount* - Defines the number of requests that may be sent simultaneously.


Configuration (Properties file)

The SFTPReceiver must read from a configuration file which contains information to be able to connect to the SFTP server.  The configuration file must contain the properties listed below. Items with an asterisk(*) are required.

  • server* - The address of the SFTP server
  • username* - The username of SFTP client
  • password* - The password of the SFTP client
  • port - The port number in which the SFTP server "listens" for client connections. If this is not set, the port will automatically be set to 22 (which is commonly used as the default port for SFTP protocol)
  • targetLocation* - The target location in the SFTP server where the files will be transferred
  • sshKnownHostsLocation* - The location of the known_hosts file in the client-server

    Below is an example configuration file:

server=192.168.254.7
username=anonymous
password=anonymous
port=22
targetLocation=/Users/SFTPServer/Downloads
sshKnownHostsLocation=/Users/SFTPClient/.ssh/known_hosts


Possible Errors

When using the SFTPReceiver, one possible error that occurs is the UnknownHostKeyException. This occurs when Genrocket cannot connect to your SFTP Server.


You can do the following commands below:

ssh-keyscan -t rsa <HOST_NAME> >> ~/.ssh/known_hosts
ssh-keyscan -t rsa <IP_ADDRESS_OF_HOST_NAME> >> ~/.ssh/known_hosts


Generic

Example Test Runs

The following example test runs were performed on a machine with the following specifications:

  • MacMini
  • Mac OS Mojave
  • 16GB RAM
  •  Intel Core I5 CPU
  • 500GB SSD

Test data used in each test run met the following criteria:

  • All test files were generated by GenRocket
  • One thousand files were generated 
  • Each file having 3KB in size

For brevity, the example runs below, show only the first 100 file transfers. 


Test Run With 1 Thread (4m:29s)

***** Transferred 0 of 1000 files to SFTP Server using 1 thread/s - Elapsed Time: 0s *****
..........
***** Transferred 10 of 1000 files to SFTP Server using 1 thread/s - Elapsed Time: 2s *****
..........
***** Transferred 20 of 1000 files to SFTP Server using 1 thread/s - Elapsed Time: 2s *****
..........
***** Transferred 30 of 1000 files to SFTP Server using 1 thread/s - Elapsed Time: 2s *****
..........
***** Transferred 40 of 1000 files to SFTP Server using 1 thread/s - Elapsed Time: 2s *****
..........
***** Transferred 50 of 1000 files to SFTP Server using 1 thread/s - Elapsed Time: 2s *****
..........
***** Transferred 60 of 1000 files to SFTP Server using 1 thread/s - Elapsed Time: 2s *****
..........
***** Transferred 70 of 1000 files to SFTP Server using 1 thread/s - Elapsed Time: 2s *****
..........
***** Transferred 80 of 1000 files to SFTP Server using 1 thread/s - Elapsed Time: 2s *****
..........
***** Transferred 90 of 1000 files to SFTP Server using 1 thread/s - Elapsed Time: 2s *****
..........
***** Transferred 100 of 1000 files to SFTP Server using 1 thread/s - Elapsed Time: 2s *****


Generic


Test Run With 2 Threads (2m:55s)

Generic
***** Transferred 0 of 1000 files to SFTP Server using 2 thread/s - Elapsed Time: 0s *****
.....
***** Transferred 10 of 1000 files to SFTP Server using 2 thread/s - Elapsed Time: 1s *****
.....
***** Transferred 20 of 1000 files to SFTP Server using 2 thread/s - Elapsed Time: 1s *****
.....
***** Transferred 30 of 1000 files to SFTP Server using 2 thread/s - Elapsed Time: 1s *****
.....
***** Transferred 40 of 1000 files to SFTP Server using 2 thread/s - Elapsed Time: 1s *****
.....
***** Transferred 50 of 1000 files to SFTP Server using 2 thread/s - Elapsed Time: 1s *****
.....
***** Transferred 60 of 1000 files to SFTP Server using 2 thread/s - Elapsed Time: 1s *****
.....
***** Transferred 70 of 1000 files to SFTP Server using 2 thread/s - Elapsed Time: 1s *****
.....
***** Transferred 80 of 1000 files to SFTP Server using 2 thread/s - Elapsed Time: 1s *****
.....
***** Transferred 90 of 1000 files to SFTP Server using 2 thread/s - Elapsed Time: 1s *****
.....
***** Transferred 100 of 1000 files to SFTP Server using 2 thread/s - Elapsed Time: 1s *****



Test Run With 3 Threads (2m:24s)

Generic
***** Transferred 0 of 1000 files to SFTP Server using 3 thread/s - Elapsed Time: 0s *****
...
***** Transferred 10 of 1000 files to SFTP Server using 3 thread/s - Elapsed Time: 1s *****
...
***** Transferred 20 of 1000 files to SFTP Server using 3 thread/s - Elapsed Time: 1s *****
....
***** Transferred 30 of 1000 files to SFTP Server using 3 thread/s - Elapsed Time: 1s *****
...
***** Transferred 40 of 1000 files to SFTP Server using 3 thread/s - Elapsed Time: 1s *****
...
***** Transferred 50 of 1000 files to SFTP Server using 3 thread/s - Elapsed Time: 1s *****
...
***** Transferred 60 of 1000 files to SFTP Server using 3 thread/s - Elapsed Time: 1s *****
...
***** Transferred 70 of 1000 files to SFTP Server using 3 thread/s - Elapsed Time: 1s *****
...
***** Transferred 80 of 1000 files to SFTP Server using 3 thread/s - Elapsed Time: 1s *****
...
***** Transferred 90 of 1000 files to SFTP Server using 3 thread/s - Elapsed Time: 1s *****
....
***** Transferred 100 of 1000 files to SFTP Server using 3 thread/s - Elapsed Time: 1s *****


Test Run With 5 Threads (2m:0s)

Generic
***** Transferred 0 of 1000 files to SFTP Server using 5 thread/s - Elapsed Time: 0s *****
..
***** Transferred 10 of 1000 files to SFTP Server using 5 thread/s - Elapsed Time: 1s *****
..
***** Transferred 20 of 1000 files to SFTP Server using 5 thread/s - Elapsed Time: 1s *****
..
***** Transferred 30 of 1000 files to SFTP Server using 5 thread/s - Elapsed Time: 1s *****
..
***** Transferred 40 of 1000 files to SFTP Server using 5 thread/s - Elapsed Time: 1s *****
..
***** Transferred 50 of 1000 files to SFTP Server using 5 thread/s - Elapsed Time: 1s *****
..
***** Transferred 60 of 1000 files to SFTP Server using 5 thread/s - Elapsed Time: 1s *****
..
***** Transferred 70 of 1000 files to SFTP Server using 5 thread/s - Elapsed Time: 1s *****
..
***** Transferred 80 of 1000 files to SFTP Server using 5 thread/s - Elapsed Time: 1s *****
..
***** Transferred 90 of 1000 files to SFTP Server using 5 thread/s - Elapsed Time: 1s *****
..
***** Transferred 100 of 1000 files to SFTP Server using 5 thread/s - Elapsed Time: 1s *****



Test Run with 10 Threads (1m:44s)

***** Transferred 0 of 1000 files to SFTP Server using 10 thread/s - Elapsed Time: 0s *****
.
***** Transferred 10 of 1000 files to SFTP Server using 10 thread/s - Elapsed Time: 1s *****
.
***** Transferred 20 of 1000 files to SFTP Server using 10 thread/s - Elapsed Time: 1s *****
.
***** Transferred 30 of 1000 files to SFTP Server using 10 thread/s - Elapsed Time: 1s *****
.
***** Transferred 40 of 1000 files to SFTP Server using 10 thread/s - Elapsed Time: 1s *****
.
***** Transferred 50 of 1000 files to SFTP Server using 10 thread/s - Elapsed Time: 1s *****
.
***** Transferred 60 of 1000 files to SFTP Server using 10 thread/s - Elapsed Time: 1s *****
.
***** Transferred 70 of 1000 files to SFTP Server using 10 thread/s - Elapsed Time: 1s *****

***** Transferred 80 of 1000 files to SFTP Server using 10 thread/s - Elapsed Time: 1s *****
.
***** Transferred 90 of 1000 files to SFTP Server using 10 thread/s - Elapsed Time: 1s *****
.
***** Transferred 100 of 1000 files to SFTP Server using 10 thread/s - Elapsed Time: 1s *****