Newer Version Available

This content describes an older version of this product. View Latest

EventPublishFailureCallback Interface

Implement this interface to track platform event messages that failed to publish. The onFailure() method in this interface is called when the final result of the asynchronous publish operation becomes available.

Namespace

EventBus

Usage

For more information, see Get the Result of Asynchronous Platform Event Publishing with Apex Publish Callbacks in the Platform Events Developer Guide.

EventPublishFailureCallback Methods

The following are methods for EventPublishFailureCallback.

onFailure(result)

The system invokes this method when the final result of EventBus.publish is available and the publishing of the platform event message failed.

Signature

public void onFailure(eventbus.FailureResult result)

Parameters

result
Type: EventBus.FailureResult
The final result of EventBus.publish.

Return Value

Type: void

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