Newer Version Available
Get the Status of Asynchronous Platform Event Publish Operations (Beta)
You can get a confirmation of the enqueued publish operation without this feature, but you don't know whether the operation eventually succeeds. A status of success in the immediately returned SaveResult means that the publish operation is queued in Salesforce. The operation is carried out later when system resources are available. Some failures are returned in the SaveResult, such as validation or limit errors, but not the asynchronous errors. In rare cases, enqueued publish operations can fail due to a system error. The benefit of status events is that you can find out about the eventual status of enqueued publish operations and perform appropriate actions.
Enable Publish Status Events
To enable receiving publish status events for your high-volume platform event, in Setup, click Track publish status on the event's definition page. Or in Metadata API, set the enablePublishStatusTracking field on CustomObject to true.
Event publish results are batched in a PublishStatusEvent and grouped by the status and topic, which is the event API name. A PublishStatusEvent doesn't necessarily correspond to one publish request. It contains results of one or more requests that are for the same platform event and have the same publish status. PublishStatusEvent can hold up to 100 publish results. Each PublishStatusEvent includes an array of PublishStatusDetail child objects containing information about each event publish operation.