SK SKYVVA Documentation

What is Queueable Apex Retry?

Overview

Queueable Apex Retry helps SKYVVA continue reprocessing messages when a Queueable Apex job becomes too large and reaches a Salesforce governor limit.

For example, a Queueable job may fail because it uses too much:

Instead of stopping the complete Reprocess Message process, SKYVVA can take the failed work, make the processing chunk smaller, and try again.

In simple terms:

If a Queueable Apex job is too large to process successfully, SKYVVA retries the failed messages using a smaller chunk.

1. Required Configuration

For an inbound interface, configure:

Inbound Processing Behavior = Queueable Apex

Configuration flow:

Integration
    ↓
Inbound Interface
    ↓
Details
    ↓
Inbound Processing Behavior
    ↓
Queueable Apex
    ↓
Save

For the feature tested in SKYVVA v2.51.18, Queueable Apex is used for this Reprocess Message feature.


2. Normal Reprocess Message

When failed messages are reprocessed, SKYVVA submits them to Queueable Apex.

Example:

Failed Messages
      ↓
Reprocess Message
      ↓
Queueable Apex
      ↓
Process Messages
      ↓
Completed

If the Queueable job finishes normally, no retry is required.


3. What Happens When the Queueable Job Reaches a Limit?

A large Queueable job can reach a Salesforce governor limit.

Example:

Queueable Apex
      ↓
Process a large message chunk
      ↓
Apex heap size becomes too large
      ↓
Queueable Job = Failed

Normally, the failed Queueable transaction cannot continue.

With Queueable Apex Retry, SKYVVA detects this failure and retries the failed work.


4. How Queueable Apex Retry Works

The retry process is:

Queueable Apex Job
        ↓
Process Message Chunk
        ↓
Governor Limit Reached
        ↓
Original Queueable Job Fails
        ↓
Finalizer detects the failure
        ↓
Failed chunk is put back into the queue
        ↓
Chunk size is reduced
        ↓
New Queueable Apex Job
        ↓
Retry Processing

The important point is:

The original failed Apex Job can still show Failed in Salesforce Apex Jobs. This does not automatically mean the complete Reprocess Message operation failed. SKYVVA can create another Queueable job to retry the failed work.

5. Simple Retry Example

Assume a Queueable job is trying to process a chunk of 1,000 messages.

1,000 messages
      ↓
Queueable Apex
      ↓
Governor Limit
      ↓
FAILED

SKYVVA requeues the failed chunk and retries with a smaller size.

1,000
  ↓ FAIL

500
  ↓ Retry

If 500 also fails:

500
 ↓ FAIL

250
 ↓ Retry

If necessary:

250 → 125 → ... → 1

For normal messages, the retry size is reduced progressively until processing succeeds or the minimum chunk size of 1 is reached.


6. Real Test Example

The feature was tested with the following configuration:

SettingValue
SKYVVA Version2.51.18
Interface APIV2
Interface DirectionInbound
Processing Package Size1,000
Inbound Processing BehaviorQueueable Apex
image

Failed Messages: 1,400

image

During Reprocess Message, one Queueable Apex job reached this Salesforce limit:

Apex heap size too large: 22928422

The Apex Job showed:

Job Type   : Queueable
Status     : Failed
Apex Class : IServiceBatchReprocess

After the failed job, additional IServiceBatchReprocess Queueable jobs were observed completing.

This is the expected retry scenario:

1,400 Failed Messages
        ↓
Reprocess Message
        ↓
Queueable Apex
        ↓
Large Chunk
        ↓
Apex Heap Limit
        ↓
Job Failed
        ↓
Requeue Failed Work
        ↓
Use Smaller Chunk
        ↓
New Queueable Job
        ↓
Retry
        ↓
Continue Processing

image

7. Why Is Queueable Apex Retry Useful?

Without retry:

Large Chunk
    ↓
Governor Limit
    ↓
FAILED
    ↓
Processing stops for that job

With Queueable Apex Retry:

Large Chunk
    ↓
Governor Limit
    ↓
FAILED
    ↓
Requeue
    ↓
Smaller Chunk
    ↓
Retry
    ↓
Continue Processing

This makes Reprocess Message more reliable when processing large or heavy messages.


8. Scheduler and Manual Reprocess

Queueable Apex Retry can be used after messages enter Queueable processing, but Scheduler and Manual Reprocess select messages differently.

Scheduler

Every scheduler run queries a maximum of 3,000 messages.

Example with 5,000 failed messages:

5,000 Failed Messages
        ↓
Scheduler Run 1
        ↓
Query 3,000
        ↓
2,000 remain

Next Scheduler Run
        ↓
Query remaining 2,000

The 3,000 value is the scheduler query limit per run.

Manual Reprocess

When the user manually selects messages, all selected messages are submitted.

Example:

User selects 5,000 messages
        ↓
Manual Reprocess
        ↓
All 5,000 selected messages are submitted

The scheduler's 3,000-message query limit does not apply to Manual Reprocess.


9. Processing Package Size vs. Retry Chunk

These are different concepts.

Processing Package Size

Controls how the selected messages are initially distributed into Queueable Apex processing.

Selected Messages
       ↓
Processing Package Size
       ↓
Queueable Apex Job(s)

Retry Chunk

Used only when Queueable processing fails because of a governor limit.

Queueable Job
      ↓
Governor Limit
      ↓
Failed Chunk
      ↓
Reduce Chunk Size
      ↓
Retry

Therefore:

Processing Package Size controls the initial processing. Queueable Apex Retry controls what happens after a Queueable processing chunk fails because of a governor limit.

10. What Should a User Check?

When testing or monitoring Queueable Apex Retry:

  1. Open Setup → Apex Jobs.
  2. Look for IServiceBatchReprocess.
  3. A Queueable job may show Failed with a governor-limit error.
  4. Check for new Queueable jobs created after the failed job.
  5. Verify the subsequent Queueable jobs complete.
  6. Check Message Monitoring and confirm the messages reach the expected final status.
Example:
Queueable
IServiceBatchReprocess
FAILED
Apex heap size too large
        ↓
Retry
        ↓
Queueable
IServiceBatchReprocess
COMPLETED
        ↓
Queueable
IServiceBatchReprocess
COMPLETED

Summary

Queueable Apex Retry means:

When Reprocess Message is running through Queueable Apex and a processing chunk fails because of an uncatchable Salesforce governor limit, SKYVVA requeues the failed work, reduces the chunk size, and retries it using another Queueable Apex job.

The easiest way to remember the feature is:

Process
   ↓
Limit Reached
   ↓
Fail
   ↓
Requeue
   ↓
Reduce Chunk
   ↓
Retry
   ↓
Continue

Version Note

This Queueable Apex Retry feature has been verified with:

In short: Queueable Apex Retry is used to recover from an uncatchable Salesforce governor-limit failure. Instead of retrying the same large failed chunk, SKYVVA requeues the failed records, reduces the processing chunk size, and retries them through Queueable Apex.
Open this article in the interactive viewer →