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
Laxmi Pandey 20Laxmi Pandey 20 

Batch apex http callout timeout issue

I have been trying to get data through a http callout in batch class. its giving max callout time 120000 exceeded errorr any  suggestion on how it can be fixed?
Khan AnasKhan Anas (Salesforce Developers) 
Hi Laxmi,

Greetings to you!

The default timeout is 10 seconds. A custom timeout can be defined for each callout. The minimum is 1 millisecond and the maximum is 120,000 milliseconds. 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.

Please refer to the below links which might help you further with the above requirement.

https://salesforce.stackexchange.com/questions/228056/first-error-exceeded-maximum-time-allotted-for-callout-120000-ms

https://developer.salesforce.com/forums/?id=906F0000000AwHYIA0

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_timeouts.htm

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas