Implement an "Apex Queue" for Async Processing - Ideas - Salesforce Trailblazer Community
Trailblazer Community

All Ideas

Idea Details

Post an Idea
This idea has been delivered and can no longer be voted or commented on. If you’d like to add to this conversation, please post a new idea.
1,060  Points voting closed
Delivered in Spring '15
Idea is generally available.

Implement an "Apex Queue" for Async Processing

Data Import & Integration

Salesforce needs a queue for processing Apex. The @future annotation, scheduling classes and Batch Apex are all fine but we really need a standard queueQuese are not rocketsurgery and have been around for quite a long time. Let’s embrace them for development. See my blog post for more info and ideas on why this should be implemented.

Here's what a queue would solve:

  1. Async processing. Apex invocations are simply passed to the queue and processed sequentially when resources are available. I typically don’t care when a process is kicked off but just that it did run and in a certain sequence. Would be great to have some sort of history similar to batch jobs.
  2. Higher limits for callouts would be awesome but there is a tipping point here. You can’t allow unlimited callouts but perhaps 200 callouts per invocation would be awesome to accomidate triggers.
  3. Ability to pass complex objects, sObjects and primitives as method parameters to methods in the queue. 
  4. Bulk processing with ability to call Batch Apex. I would love to push a call to the queue that in turn kicks off a batch process in the same thread.
  5. No more issues with calling a @future method from a @future method as each call would be replaced by sending the Apex invocation to the queue.
  6. Much easier to test as you don’t have to worry about startTest() and stopTest().

· Flag

Latest Comment from Salesforce

  • IdeaExchange Moderator - 5 years ago

    For information on Flex Queue in Spring 15, please see the release notes:

    And on chaining more jobs with Queueable Apex in Spring 15:

    Previous Update from Josh:
    Item 1 will be delivered with Flex Queue, which is scheduled for GA in Spring '15.

    Item 2 has been delivered in Winter '15, with an increase to 100 callouts.  You are still subject to the 120s aggregate timeout.

    Item 3 has been delivered in Winter '15 with the Queueable interface.

    Item 4 has always been available, but not in the same thread. I don't think that the delay of one trip through MQ is enough that we'll address the "same thread" request.

    Item 5 is being addressed by Queueable. For Winter '15, Queueable will be able to call another Queueable, but only once. In Spring '15 we will allow further chaining.

  • Upvotes
  • Downvotes



from AppExchange


No results found.

Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.



Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.

Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.


Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.