1

I would like to confirm the following points with regard to Asynchronous Apex and particularly to these 3 in particular - Future Methods, Batch Apex and Queueable Apex.

  1. When an async request is made, the request is put into a queue. -> This applies to all 3, right? Is there a limit to how many requests can be on this queue?
  2. If the request cannot be processed immediately by the system, it goes in holding status and is placed in a separate queue (the Apex flex queue). Up to 100 requests can be in the Apex flex queue and if this is exceeded, an AsyncException is thrown -> Does this apply only to Batch Apex?
  3. Is the 100 limit on the Apex flex queue absolute i.e. does not depend on the Salesforce edition and cannot be increased under any circumstances?

1 Answer 1

3

When an async request is made, the request is put into a queue. -> This applies to all 3, right? Is there a limit to how many requests can be on this queue?

Correct, there are queues for all three types. There is no limit on how many future or queueable jobs can be queued. Batchable classes depend on the Flex queue if they cannot start immediately, or the Schedulable queue when scheduled for the future.

If the request cannot be processed immediately by the system, it goes in holding status and is placed in a separate queue (the Apex flex queue). Up to 100 requests can be in the Apex flex queue and if this is exceeded, an AsyncException is thrown -> Does this apply only to Batch Apex?

Only Batchable classes are subject to the flex queue limit. Future and queueable methods have no such limit. It should never be possible to get an AsyncException assuming the other limits are not violated (the 50 calls per transaction limit).

Is the 100 limit on the Apex flex queue absolute i.e. does not depend on the Salesforce edition and cannot be increased under any circumstances?

Yes, it is absolute and involatile. Keep in mind that technically you're allowed a total of 105 Batchable calls, because up to 5 can be running at once.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .