Automated Notification for Zero-Size Files in OIC SFTP Polling
Usecase:
In many integrations, files are regularly polled from an SFTP server and processed further. However, sometimes empty (zero-byte) files may be placed due to upstream issues or accidental drops. Processing such files can cause failures or incomplete data flow. To handle this proactively, we need to automatically detect zero-size files during polling and send immediate notifications to relevant teams, enabling quick corrective action.
Solution Steps:
-
List Files from SFTP
Use the FTP Adapter in List operation to fetch all available files. -
Loop Through File List
Use a For-Each action to iterate through each file entry. -
Check File Size
Access theFileSize
attribute. If size is0
, it's an empty file. -
Send Email Notification
Use the Email Adapter to notify recipients that a zero-size file was detected. -
Optional: Log or Archive
Store the file details or move the empty file to a separate folder for tracking.
In this integration, we list files from the SFTP location, check the file size using a conditional check, and if the size is zero, we use the 'throw new fault' action to raise an error. This triggers the Global Fault Handler, which then sends an email notification indicating that a zero-size file was received.
No comments:
Post a Comment