function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Best way to handle timeouts when sending data to another system...

What is the best approach to handle timeouts (120 second max in SF) when sending data to another system via HTTP callout.
Data is sent and received and stored in the destination system but SF doesn't get the response back in the allotted time; therefore, we receive the timeout error and log it in SF as such.  The process has to hop through several layers within our company (I don't fully understand the details on that) but nonetheless, it is confirmed that the data reaches the destination and the response just does not come back to SF in time.

In a none perfect world lets say we will never get the response back in the 120 second time frame.  What would be the best design approach.

I was thinking that we would create the error record in SF due to the 120 time as we already do.  But the destination system should perform an update back to our system on the error record settting a checkbox named Validated.  This way we can at least rule out that error record as one to follow up on research.

Need help please!  What says you? 
1)Try to improve the performance of the destination system.
2) if option 1) is not possible modify the destination system to work as asynchronous service. develop a wrapper service that salesforce will call and store the information sent by salesforce in a data store. write a batch process in the destination system to call the existing servcie using the data store.
3) if option 2) is not possible, Create two system fields on the sfdc object (isSucess and retry count). write a batch apex in sfdc to reprocess the record based on isSucess field and notify the support team if retry count > max_retry. update your destination system service to return if the request is already processed