I have an implementation of the streaming api using the .NET CometD client to receive PushTopic changes from a Salesforce platform application. Due to the nature of the process it will in turn trigger, it needs guaranteed at least once delivery. This used to be a slam dunk with outbound messages as they automatically retried.

How do I automatically queue a retry of a failed message once it has passed by and the client is still connected, now moved on to later replay id's.

Do I have to explicitly stop / reconnect at the particular failed replay id?

Example for clarity: The message with replayId 84 fails, but then 85 and 86 come through no problem. Now the "latest" is 86, but 84 still need to be retried.

1 Answer 1


Does this help? source https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/using_streaming_api_stateless.htm

“In API version 37.0 and later, Streaming API stores events for 24 hours, enabling you to replay past events. With durable streaming, messages aren’t lost when a client is disconnected or isn’t subscribed. When the client subscribes again, it can fetch past events that are within the 24-hour retention period. The ability to replay past events provides reliable message delivery.

In API version 36.0 and earlier, Streaming API doesn’t maintain client state nor keeps track of what’s delivered. The client might not receive messages for several reasons”

source #2 : https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/using_streaming_api_durability.htm

Replaying Events within retention window: enter image description here

  • Yes, it does help, but I'd like to know what to do about the scenario in which I have a message that failed to process and the listener has moved on to the next replay id, which is successful. Now that a later replay id worked, the state has been updated and the failed one gets ignored. How do I ensure the failed one get retried using something like an ACK?
    – Kyle J V
    Commented Dec 31, 2020 at 14:24
  • 1
    See “replaying events”. I suspect you have to use the api to choose an event within the retention window to replay. I have revised the answer. If anyone has another approach please post as an answer Commented Dec 31, 2020 at 15:29
  • This additional information is helpful to anyone else who views this question, but I'm already using the replay option and keeping track of the "latest" replayId. My question speaks in bold about how do I automatically retry a failed message. Example, the replayId 84 fails, but then 85 and 86 come through no problem. Now the "latest" is 86, but 84 still need to be retried.
    – Kyle J V
    Commented Dec 31, 2020 at 15:37
  • 1
    i trust youre aware of outbound message considerations. If not see “2 hour” and “24 hour” considerations in the docs, help.salesforce.com/… Commented Jan 12, 2021 at 1:31
  • 1
    Yes, I am, thanks for noting. I hope our answers and comments make a comprehensive reference for future browsers
    – Kyle J V
    Commented Jan 12, 2021 at 1:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .