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.
| Feature | Change Data Capture Event | Platform Event | PushTopic Event (Legacy) | Generic Event (Legacy) |
|---|
| Define a custom schema as strongly typed fields | N/A |  | N/A |  |
| Include user-defined payloads | N/A |  | N/A |  |
| Publish custom events via one or more APIs | N/A |  | N/A |  |
| Publish events via Apex | N/A |  | N/A |  |
| Publish declaratively using Process Builder and Flow Builder | N/A |  | N/A |  |
| Publish to specific users | N/A |  | N/A |  |
| Subscribe via CometD using JavaScript, Java, and other languages |  |  |  |  |
| Subscribe via Pub/Sub API |  |  |  |  |
| Subscribe via Apex triggers |  |  |  |  |
| Filter subscriptions |  |  |  |  |
| Receive auto-published event notifications for Salesforce record changes |  | N/A |  | N/A |
| Choose the fields to include in event notifications for Salesforce record changes |  | N/A |  | N/A |
| Receive a versioned event schema |  |  |  |  |
| Get field-level security |  |  |  |  |
| Get record-sharing support |  | N/A |  | N/A |
| Encrypt field data with Shield Platform Encryption |  |  |  |  |
| Replay retained event notifications |  |  |  |  |
| Event retention period | 3 days | 3 days* | 1 day | 1 day |
* Standard-volume platform events are retained for 1 day.
See Also