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
Karthikeyan ChandranKarthikeyan Chandran 

Exceeded maximum time allotted for call out (120000 ms)

Hello,

Exceeded maximum time allotted for call out (120000 ms)

I'm getting the Exceeded maximum time allotted for call out (120000 ms) error.

It seems salesforce doesn't allow more than 120 second for a single response.

I just send a 50 files (Resumes) to the resume parser in a single transaction and the resume parser take more than 120 seconds and we are getting the time exceed exceptions.

Is there is any way to resolve this.

Thanks & Regards,
Karthikeyan Chandran
Best Answer chosen by Karthikeyan Chandran
Karthikeyan ChandranKarthikeyan Chandran
Thanks James!

It's worked for me, I've created batch and executed as a 5 per execution.

Now, I just call the batch class through the command button from one of my VF page and it should return the SUCCESS/ERROR files.

I used SaveResult[] instead of normal DML to get all the record success in the batch class. Unfortunately I am unable to fetch the values in my VF page where the batch class invoked. Tried to use batch class as a Extension, but I am not sure how to do achieve this.

If we do via any argument passing can we have all the values in the SaveResult[] array or the last batch 5 (batch size =5) will store in the array.

Looking for the possibilities and best practices to acheive this.

All Answers

Balaji Chowdary GarapatiBalaji Chowdary Garapati
@Karthikeyan Chandran:


  I dont think there is a possible resoultion from salesforce.com end! Take a look at below link which explains the limits on a webservice transaction.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_callouts_timeouts.htm

The third party system handling the request should be capable of parsing the request you sent and responding back within the 120 Sec time constraint.

If the third party system can tweak their code and process the request faster, it would solve the issue or the only way would be limiting/reducing your input size per transaction.

Thanks,
Balaji
Karthikeyan ChandranKarthikeyan Chandran
Thanks for the reply Balaji.

I tried to check with third party system, they won't support the this limited time period.

For each file they take 2 to 5 seconds, Is there is any way to separate the Apex transaction? Right now I just iterating all attachments and sent out the resumes in the call outs. Is there is any way to store it any where and do it by each single call and get response, once it complete, we can send out alert something like that?

Looking for the suggestions!

Thanks & Regards,
Karthikeyan Chandran
James LoghryJames Loghry
You should be able to loop through, and say in chunks or batches of 10 resumes (or whatever number you chose) and issue callouts.  You can make up to 100 callouts in a transaction now that the limit has been increased from 10.
Karthikeyan ChandranKarthikeyan Chandran
Thanks James!

It's worked for me, I've created batch and executed as a 5 per execution.

Now, I just call the batch class through the command button from one of my VF page and it should return the SUCCESS/ERROR files.

I used SaveResult[] instead of normal DML to get all the record success in the batch class. Unfortunately I am unable to fetch the values in my VF page where the batch class invoked. Tried to use batch class as a Extension, but I am not sure how to do achieve this.

If we do via any argument passing can we have all the values in the SaveResult[] array or the last batch 5 (batch size =5) will store in the array.

Looking for the possibilities and best practices to acheive this.
This was selected as the best answer