Streaming Event Features

The Lightning Platform offers several types of streaming events. To determine which event meets your use case, compare the features of the various events.

PushTopic and generic events are legacy products. Salesforce no longer enhances them with new features and provides limited support for them. Instead of PushTopic events, consider using Change Data Capture events. Instead of generic events, consider using Platform Events. To learn about Change Data Capture events, see the Change Data Capture Developer Guide and the Change Data Capture Basics Trailhead module. To learn about Platform Events, see Platform Events Developer Guide and the Platform Events Basics Trailhead module.

Important

FeatureChange Data Capture EventPlatform EventPushTopic Event (Legacy)Generic Event (Legacy)
Define a custom schema as strongly typed fieldsN/AYesN/ANo
Include user-defined payloadsN/AYesN/AYes
Publish custom events via one or more APIsN/AYesN/AYes
Publish events via ApexN/AYesN/ANo
Publish declaratively using Process Builder and Flow BuilderN/AYesN/ANo
Publish to specific usersN/ANoN/AYes
Subscribe via CometD using JavaScript, Java, and other languagesYesYesYesYes
Subscribe via Pub/Sub APIYesYesNoNo
Subscribe via Apex triggersYesYesNoNo
Filter subscriptionsYesYesYesNo
Receive auto-published event notifications for Salesforce record changesYesN/AYesN/A
Choose the fields to include in event notifications for Salesforce record changesNoN/AYesN/A
Receive a versioned event schemaYesYesNoNo
Get field-level securityYesNoYesNo
Get record-sharing supportNoN/AYesN/A
Encrypt field data with Shield Platform EncryptionYesYesNoNo
Replay retained event notificationsYesYesYesYes
Event retention period3 days3 days*1 day1 day

* Standard-volume platform events are retained for 1 day.

See Also