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.

EventBus

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.

  • 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.

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)

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.