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.
For more information, see Get the Result of Asynchronous Platform Event Publishing with Apex Publish Callbacks in the Platform Events Developer Guide.
The following are methods for EventPublishSuccessCallback.
-
The system invokes this method when the final result of
EventBus.publishis available and the publishing of the platform event message succeeded.
The system invokes this method when the final result of EventBus.publish is available and the publishing of the platform event message succeeded.
public void onSuccess(eventbus.SuccessResult result)
-
result:
Type: EventBus.SuccessResult
The final result of
EventBus.publish.
Type: void
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.