How to resume the Salesforce Platform Event trigger from the failed replayId due to Uncaught Exceptions?

How to resume the Salesforce Platform Event trigger from the failed replayId due to Uncaught Exceptions?

Salesforce Platform Events trigger ends abruptly when it hits Uncaught exceptions like Governor limits.

EventBus.TriggerContext.currentContext().setResumeCheckpoint(replayId) can be used to resume the Platform Event trigger from the failed replayId.

replayId passed will be used to resume the Salesforce Platform Event trigger from the failed replayId due to Uncaught Exceptions.

Reference Article:

https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_subscribe_batch_resume.htm

Note:

The default batch size is 2000. To avoid hitting the uncaught exceptions, lower the batch size.

Leave a Reply

Your email address will not be published.