1

I am calling a REST API from my Salesforce instance which generally takes 100-150 seconds to process and return the result. The cumulative apex callout time limit is 120 seconds. Is there any way where I can increase this limit so that the exception wont't be raised?

2

You are out of luck here as this is a hard limit enforced as part of Execution Governors and Limits.

Maximum cumulative timeout for all callouts (HTTP requests or Web services calls) in a transaction 120 seconds.

Also refer on Callout Limits and Limitations (emphasis mine).

The maximum cumulative timeout for callouts by a single Apex transaction is 120 seconds. This time is additive across all callouts invoked by the Apex transaction.

You will need to revisit your implementation to be able to get a response well within the limits defined by Salesforce.

0

No, this limit cannot be raised. You need to find a way to re-architect your endpoint so it can return a response within 120 seconds reliably.

0

What you could try is to check to see if the callout times out and then rerun it again if indeed it timed out, if it really does sometimes return under the 120 second limit you might be able to increase the likelihood of actually getting a response (not a great solution but a potential workaround at least since governing limits can't be broken)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.