
There are some errors while saving file to SFTP server, which happen after the SFTP connection has been establish. The in-built retry function is not applied, as it is specified in the SAP Help documentation:
https://help.sap.com/docs/cloud-integration/sap-cloud-integration/configure-sftp-receiver-adapter
'Maximum Reconnect Attempts' setting is only relevant for establishing the initial connection to the server. If the server connection is interrupted during message processing, the connection will not be recovered. A retry attempt of the interrupted message processing can only be achieved by explicitly modeling this functionality via integration flow.
For instance, the error I needed to handle was
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot store file
In such case the integration processing fails. We can handle the error in exception subprocess, but if we want to apply a retry mechanism, we can't really do that within exception subprocess.
I suggest following solution: we decouple main process from the process of saving the file via SFTP.
Let's say we receive a file via HTTPS and we want to save it to SFTP.
The simplified main iflow will look as follows:
And this is our new integration flow, which manages saving the file to SFTP server.
This repeats till the file is saved successfully or the number of attempts is depleated. In that case we receive an alert email, stating that even after 5 attempts the file was not saved.
Even though simplified, the above example demonstrates the principles by which we handled an SFTP error and implemented a custom retry mechanism.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |