Questions tagged [queueable-interface]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
24 votes
2 answers
6k views

Can we callout and chain a Queueable class?

I'll jump right into some code: public class ChainQueue implements Queueable, Database.AllowsCallouts { public void execute(QueueableContext context) { if(QueueUtil.hasNext()) { ...
sfdcfox's user avatar
  • 489k
27 votes
4 answers
27k views

Can Queueable solve "Future method cannot be called from a future or batch method"?

I have code that must be called as @future as it requires all the resources one can get. The only problem is that in 1% of the cases this code is called from a Batch and therefore fails with System....
Robert Sösemann's user avatar
103 votes
1 answer
4k views

When are the Queueable/Batchable penalties going to be enforced?

According to The New Apex Queueable Interface, from October 2014, we were told that chained Queueable calls would be exponentially delayed up to 64 seconds, chaining Batches would be exponentially ...
sfdcfox's user avatar
  • 489k
32 votes
1 answer
24k views

System.AsyncException: Maximum stack depth has been reached

I have two Queueable classes, I am trying to execute them by chaining them. First approach was to calling second queueable from first class. But, it gives me System.AsyncException: Maximum stack depth ...
Devendra's user avatar
  • 5,075
8 votes
2 answers
4k views

System.AsyncException: Maximum callout depth has been reached

I have a System.Queuable job, on a particular Sandbox that is giving me issues. It works fine on other Orgs, but fails on this particular one. The job structure is this: Batch Apex job calls System....
Phil Hawthorn's user avatar
3 votes
1 answer
2k views

How's This for a Simple HTTP Callout Retry Framework?

Most of what I have read about retry operations is that they are vaguely complicated and indepth. I have written the code below which seems to accomplish this without too much confusion - I'm ...
number41's user avatar
  • 948
2 votes
1 answer
6k views

Apex Blob data chunking

I am able to upload the Blob data to the local web server. However, the I have run into the error "Exceeded max size limit of 12000000 with request size xxxxx" This means that the file size is ...
dmachop's user avatar
  • 1,089
21 votes
1 answer
5k views

Can Queueable Apex Jobs Run in Parallel?

I've got a queueable Apex class that can create parent records for sources records passed into it. It maintains a map as it goes so that if two source records should relate to the same parent and it ...
Matt Lacey's user avatar
  • 25.6k
16 votes
2 answers
7k views

Governor Limits on System.enqueueJob in Asynchronous Apex – Documentation Wrong?

Is there any execution context which uses asynchronous governor limits and allows up to 50 jobs to be queued with System.enqueueJob in a single transaction, or is Salesforce’s documentation just wrong?...
Sequoyah's user avatar
  • 760
11 votes
2 answers
2k views

"Callout loop not allowed" in unit test for Queueable that implements HttpCalloutMock

I'm attempting to do a unit test for a Queueable that does an Http callout. When I run the test I get an exception: "System.CalloutException: Callout loop not allowed". Previously I was using @...
Phil Lawrence's user avatar
11 votes
2 answers
12k views

When passing in a collection of sObjects to a Queueable what values are used?

Suppose I pass in a collection of sObjects to a queueable. Does the queueable execute on the values of the sobjects field that get passed when the queueable is invoked? Given it is possible for these ...
PartOfTheOhana's user avatar
10 votes
0 answers
822 views

Implement Domain Event Pattern in Apex - can and should it be done?

In Domain Driven Design a single pattern is drawing a lot of attention to itself - Domain Events and Event Queues. (slide via http://de.slideshare.net/andysal/never-mind-the-bollocks-heres-the-domain-...
Robert Sösemann's user avatar
8 votes
1 answer
807 views

Throttling http callouts across queueables executed in parallel

I have a batch job which processes millions of records through an HTTP callout to a third-party API. The API doesn’t handle batching, so each record needs its own callout. It takes well over 24 hours ...
Sequoyah's user avatar
  • 760
8 votes
1 answer
2k views

Point to Point integration vs middleware

I'm a newbie in integrations and I've been recently thinking about when to use Point to Point and middleware integrations. My goal is to somehow understand how to decide which one is the best when ...
DevelBase2's user avatar
6 votes
0 answers
898 views

Execute some code after all trigger batches complete?

Suppose I update 1000 records and I have an after update trigger. That trigger will run 5 times for each batch of 200. Is there any possible way to collect data over the course of the 5 executions and ...
Charles T's user avatar
  • 11k
6 votes
2 answers
656 views

How to mix getContentAsPDF calls with DML?

This critical update: PageReference getContent() and getContentAsPDF() Methods Treated as Callouts will be auto-activated in January 2016. We have some code that uses a queue of custom event ...
Keith C's user avatar
  • 136k
4 votes
3 answers
3k views

How to set time limit between queued jobs?

So I am looking to implement Queueable jobs in apex to send 200 emails (1 job) every 30 minutes until all the jobs are done, I am struggling to find any documentation on how this functionality can be ...
Nebbyyy's user avatar
  • 838
3 votes
1 answer
493 views

Is there a way to chain jobs indefinitely?

What I mean is that I want a way of running some kind of loop indefinitely. This loop is going to make a callout to an endpoint, and it needs to be fast (so it can't be scheduled to run 10 to 10 ...
Renato Oliveira's user avatar