Newer Version Available
EventPublishSuccessCallback Interface
Implement this interface to track platform event messages that were published
successfully. The onSuccess() method in this interface is
called when the final result of the asynchronous publish operation becomes
available.
Namespace
Usage
For more information, see Get the Result of Asynchronous Platform Event Publishing with Apex Publish Callbacks in the Platform Events Developer Guide.
EventPublishSuccessCallback Methods
The following are methods for EventPublishSuccessCallback.
onSuccess(result)
The system invokes this method when the final result of EventBus.publish is available and the publishing of the platform event message
succeeded.
Signature
public void onSuccess(eventbus.SuccessResult result)
Parameters
- result
- Type: EventBus.SuccessResult
- The final result of EventBus.publish.
Return Value
Type: void
EventPublishSuccessCallback Example Implementation
For an example implementation and a test class, see Get the Result of Asynchronous Platform Event Publishing with Apex Publish Callbacks in the Platform Events Developer Guide.