Newer Version Available

This content describes an older version of this product. View Latest

Comparing setResumeCheckpoint() and EventBus.RetryableException

Determine which method is most suitable for resuming a platform event trigger. Use setResumeCheckpoint() when the trigger has processed event messages successfully before an unhandled exception occurs, such as a limit exception. After the exception, the trigger resumes after the last checkpointed event message. Throw the EventBus.RetryableException to reprocess events when you expect an external condition to change or a transient error to go away.
setResumeCheckpoint() Method EventBus.RetryableException
Trigger execution continues after setResumeCheckpoint(). Trigger execution halts after the EventBus.RetryableException is thrown.
DML operations performed are committed. DML operations performed before the exception is thrown are rolled back and not committed.
When the trigger fires again, only the event messages after the one with the specified replay ID are resent, in addition to any new event messages. When the trigger fires again, all event messages from the previous batch are resent in the new batch, in addition to any new event messages.
These TriggerContext properties don’t apply and aren’t populated: retries and lastError. These TriggerContext properties are populated: retries and lastError.