Newer Version Available

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

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

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

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