Subscription Channels
You can subscribe to channels by supplying the channel endpoint. For example, to subscribe to events for all selected entities, subscribe to /data/ChangeEvents. Apex triggers can't subscribe to channels but can subscribe to a single event only. For example, you can create an Apex trigger on AccountChangeEvent to subscribe to only Account change events.
Standard Channels
The ChangeEvents standard channel contains change events from one or more selected entities in a single stream that you can subscribe to. If you expect change events from more than one entity, use the ChangeEvents standard channel. To receive change events on the ChangeEvents channel, select the entities for Change Data Capture. For more information, see Select Objects for Change Notifications in the User Interface and Select Objects for Change Notifications with Metadata API and Tooling API. Then subscribe to the appropriate channel.
If you expect change events for only a single entity, use single-entity channels. With single-entity channels, you can subscribe to change events from only one custom object or standard object. Select the entity for notifications on the Change Data Capture page in Setup or in a custom channel.
- Standard Channel for All Selected Entities
-
/data/ChangeEvents
- Single-Entity Channel for a Standard Object
-
/data/<Standard_Object_Name>ChangeEvent
- For example, the channel to subscribe to change events for Account records
is:
/data/AccountChangeEvent
- Single-Entity Channel for a Custom Object
-
/data/<Custom_Object_Name>__ChangeEvent
- For example, the channel to subscribe to change events for Employee__c custom object
records is:
/data/Employee__ChangeEvent
Custom Channels
Create a custom channel if you have multiple subscribers and each subscriber receives change events from a different set of entities. Also, use a custom channel with event enrichment to isolate sending enriched fields in change events on a specific channel. Custom channels group and isolate change events for each subscriber so subscribers receive only the types of events they need. Entities are automatically selected for change event notifications when you create a custom channel that includes them. A custom channel has the following format.
/data/YourChannelName__chn
/data/SalesEvents__chn