Introduction of SFTP Poller Handler
Here in this blog, we will learn about SFTP Poller Handler.
SFTP (Secured File Transfer Protocol) poller handler is used to retrieve message files from the target directory and routes messages to an HTTP Application server, FTP server, MQ and SFTP. Server for processing after processing capture the response and place the file in FTP or SFTP server. With this SFTP we can easily capture the files from remote directory using data power.
Use cases of SFTP poller handler:
-
Automation of File Monitoring:
It will be used for automating the monitoring of specified directories for incoming files no need of manual interventions as soon as the file has been arrived in specific folder it will be picked and processed.
-
Polling Intervals:
There is a flexibility of polling intervals users can define time intervals for file processing and can able to Rename or delete the file after successful processing.
-
Error Notification Alert:
In addition to SFTP if we can configure log targets and SMTP to receive error notification through email in case of any issue faced during file transfer.
Configuration steps for SFTP poller handler through MPGW:
- Click on SFTP poller handler and provide sample name.
- On the target directory column give the directory path where we need to pick the file.
- On delay between polls give the value in milliseconds approx. give the value as 30000 i.e 3 sec as it is sufficient for file processing.
- On input file match pattern give the PCRE expression to pick the file with same name pattern as PCRE other than PCRE pattern no other file will be picked and processed.
- Processing file rename pattern it is used to rename the file after processing.
- Enable the delete input file on success so that file will be deleted from target directory after processing.
- Processing seize timeout is used to define the time value to wait before processing a file that is already in the processing state.
SSH Client Connection configuration:
- For SFTP poller SSH is mandatory as it is a secured channel we can define SSH in two ways.
- Provide the SFTP user name in user name field of SSH Client profile.
- Select the user authentication mode as password (it can be done in two ways one is using the respective public key if we don’t have the SFTP password or we can use password directly if we are having SFTP password.
- Configure the password using password MAP alias.
User Agent configuration:
- We need to configure the user agent for routing message files to SFTP server.
- In user agent click on basic-auth policy tab.
- Configure the url matching expression user name and password Map alias for authentication of SFTP server this is used for poller directory .
- Click on SFTP client policies tab and provide the URL expression as remote directory where we need to place the file SSH client profile which we have created earlier.
- Enable use unique file names so that unique file names can be generated.
- Create one new XML manager and refer the user agent which we have created earlier.
MPGW Configuration:
- Create one new MPGW and processing policy as both directions and select the Xml manager and front side protocol as SFTP poller handler which we have created earlier.
- We can configure error rule in processing policy so that any errors occurred during transmission of file can be notified through email.
- Select static back end and provide the default backend url where we need to place the file.
- Select the request type as non-xml and response type as pass through as we are not altering any file data.
- Place the SFTP poller directory with PCRE naming pattern it will be picked with polling intervals and processed accordingly.