ApexSensei

Drills Asynchronous Apex

Make a Queueable retry idempotent

A retry is idempotent when running it twice has the same effect as once.

Your task

Complete the Queueable so each operation key adds 1 to an Account's NumberOfEmployees at most once, even when an old key comes back late.

public class AS_F101E8C41745_IdempotentSyncJob implements Queueable {
    private Set<Id> accountIds;
    private String operationKey;

    public AS_F101E8C41745_IdempotentSyncJob(Set<Id> accountIds, String operationKey) {
        this.accountIds = accountIds;
        this.operationKey = operationKey;
    }

    public void execute(QueueableContext context) {
    }
}

Requirements

  1. appliesFirstOperation should pass
  2. skipsDuplicateQueuedRetries should pass
  3. skipsLateRetryOfOlderKey should pass
  4. appliesLookalikeKey should pass
  5. processesTwoHundredAccounts should pass

Sign in to open this drill