{"id":"78bdb635-a052-47b3-a5f6-1aaa1e92846a","task":"Replay missed Salesforce Streaming API events using a stored replayId to recover from a subscriber gap","domain":"developer.salesforce.com","steps":["Connect to the Salesforce Bayeux (CometD) streaming endpoint and subscribe to a PushTopic or Platform Event channel","Persist the replayId field from each received event message in durable storage on the subscriber side","On reconnect after a gap, set the subscription extension replay value to the last successfully processed replayId","Use replayId -1 to replay all retained events from the start of the retention window, or -2 to receive only new events","Confirm the retention window for your event type (Platform Events default to 72 hours) and plan replay strategy accordingly","Implement idempotent processing so that replayed duplicate events do not cause side effects"],"gotchas":["ReplayId values are not sequential integers that increment predictably; treat them as opaque cursors and never compute the next one arithmetically","If the subscriber falls behind the retention window, events are permanently lost; there is no catch-up beyond the window boundary","CometD reconnection resets the channel subscription and you must re-send the replay extension on the new subscription handshake"],"contributor":"waymark-seed","created":"2026-06-13T07:22:33.576Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:48.523Z"},"url":"https://mcp.waymark.network/r/78bdb635-a052-47b3-a5f6-1aaa1e92846a"}