EventBus Namespace

The EventBus namespace provides classes and methods for platform events and Change Data Capture events.

The following are the classes in the EventBus namespace.

  • ChangeEventHeader Class

    Contains header fields of Change Data Capture events.

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

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

  • FailureResult Interface

    Contains the result of an Apex publish callback when the event publishing failed. This interface is used as a parameter in the onFailure method of the EventPublishFailureCallback interface.

  • SuccessResult Interface

    Contains the result of an Apex publish callback when the event publishing succeeded. This interface is used as a parameter in the onSuccess method of the EventPublishSuccessCallback interface.

  • TestBroker Class

    Contains methods that simulate the successful delivery or failed publishing of platform event or change event messages in an Apex test.

  • TriggerContext Class

    Provides information about the platform event or change event trigger that’s currently executing, such as how many times the trigger was retried due to the EventBus.RetryableException. Also, provides a method to resume trigger executions.

See Also