Hi All,
Can anyone suggest below requirement how to approach,
API Retry Functionality
The API Retry Functionality is designed to ensure reliable and orderly communication with the exte system, even in the presence of transient errors. Its primary goal is to detect errors during the sending of an API call chain, trigger targeted retries and preserve the correct execution sequence. This approach prevents unnecessary duplication and maintains data integrity.
Requirements and Logic
Error Detection: Monitor each API call in the chain for negative responses or failures.
Order Preservation: Always send API calls in the precise order defined in the previous section to respect entity dependencies.
Targeted Retry: If an API call fails, retry only from that specific call rather than resending the entire chain.
Chain Pause and Resume: Upon a failed call, pause the sequence. Resume from the failed point once the retry succeeds.
User Notification: If repeated retries fail, display the message: "An application error occurred, please contact XXXX."
Additional Insights
Implementing exponential backoff for retries can help prevent overwhelming the ext system during outages. Logging all errors and retry attempts is recommended for troubleshooting and audit purposes. Adjustable retry limits should be configurable based on system requirements.
Regards
Hello @Preeti zade,
I think you can find most of the answers to these questions by implementing Distributed Transaction pattern. You can watch a video explaining the concept here: Distributed Transactions Patterns
Hello @Preeti zade
Suggested flow:
This approach:
NOTE:- Please follow best practices of timers, like timeout handling, for each record, checking if the timer is near its timeout
Thank you Gourav for the reply,
It would be helpful if any sample with this approach is available,
I have made one sample use case for your reference
Please find the attached OML and go to the APIrequests_Action server action
I have not implemented the maximum retry logic here. You can just add a small check on error flow that if the retry is greater than 5, you can mark that record as IsProcessed = True with an error message
Hello @Gourav Shrivastava
Thank you
But all my apis are getting called on submission of some form in sequence so how I will call the failed apis and below you have mentioned to call api so intial logic should be there to call failed apis in timer?
I mean in my positive flow of submission of form if the api fails,do I need to add some logic that api failed and invoke only those apis from timer?
But if the apis are depends on each other then How I will use timer,can you clarify