Newer Version Available

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

Replay PushTopic Streaming Events (Beta)

Salesforce stores PushTopic-based events for 24 hours and allows you to retrieve stored and new events. Subscribers can choose which events to receive by using replay options.

Durable PushTopic Streaming (Beta) is production quality but has known limitations. You can provide feedback, suggestions, and questions for this feature in the Durable Streaming API group in the Salesforce Success Community. For information on enabling this feature for your org, contact Salesforce.

Note

The subscriber can choose which events to receive, such as all events within the retention window or starting after a particular event. The default is to receive only the new events sent after subscribing. Streaming API uses an event framework that decouples event producers from event consumers. Therefore, a subscriber can retrieve events at any time and isn’t restricted to listen to events at the time they’re sent. Events outside the 24-hour retention period are discarded.

The way PushTopic events are replayed is identical to how Generic Streaming events are replayed, except for the subscription channel. The channel for PushTopic events includes the name of the PushTopic. For example:

1"channel":"/topic/MyTopicName"

You can subscribe to a PushTopic channel by passing replay options to a CometD extension at the following replay endpoint.

1https://Salesforce_Instance/cometd/replay/36.0/

To learn how to pass options to the replay CometD extension, see the code examples in Replay Events Sample: Code Walkthrough. Also, check out these code samples on GitHub.