SAP Cloud Integration: Generate Alert if file not found in Sender SFTP Folder
This document provides a way to leverage existing SAP Cloud Integration functionality to raise an alert when polling for a file from source SFTP Folder does not yield any results (Specified file does not exist in source folder).
To achieve this use case, we will use Poll Enrich pattern of SAP Cloud Integration.
To understand the functionality of Poll Enrich Pattern please click here.
Apart from the use cases illustrated in above blog post we can also use poll enrich to raise an exception in case no file is found in source SFTP folder.
To Achieve this:
- In the Processing tab of poll enrich select Aggregation Algorithm as Concatenate and Check the option Throw Exception if no Message Found.
Error Message received in Cloud Integration
org.apache.camel.CamelExchangeException: Error occurred during aggregation. Exchange[ID-5eb31a92-e4d2-46db-50e1-2fba-1642058552768-23-1]. Caused by: [org.apache.camel.RuntimeExchangeException - Polling with given parameters did not return any message.], cause: org.apache.camel.RuntimeExchangeException: Polling with given parameters did not return any message.
Doing this, whenever the specified file is not found in source directory, CPI iFlow fails in runtime and we can use this to catch exception using an Exception Sub Process and send an alert mail to the concerned team.