replay functionality is not working - Platform events
See original GitHub issueI am trying to subscribe to a platform event in salesforce and it works fine - except ability to replay events -either from a specific replayId or from the earliest available (-2). Below is the code that I am using - which is taken from a sample code provided in a salesforce doc but is not working - any help would be greatly appreciated.
`org.authenticate({ username: USERNAME, password: PASSWORD,securityToken: SECURITY_TOKEN }, function(err, oauth) { if(err) return console.log("Error authenticating to Salesforce, " + err); var client = org.createStreamClient();
REPLAY_ID = -2;
console.log("Latest REPLAY_ID - ", REPLAY_ID);
}
});
var accs = client.subscribe({topic:TOPIC, isEvent:true, **retry: -2**});`
I have also tried using “replayId” and “replayFrom” instead of retry but still no good. I am running this code from AWS Lambda - Node JS .
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9 (1 by maintainers)
Top Results From Across the Web
The Replay Id of child event is less than the parent event
I am publishing the events in such a way that first the controller executes the publish method for Parent and then the child...
Read more >Salesforce Replay Channel Listener Does Not Subscribe To ...
After restarting a Mule application, Salesforce Replay Channel Listener does not consume Platform Events. It was solved after another Mule app ...
Read more >Retrieving old platform events using replayId as -2
I could not figure out why it sometimes retrieves old events and sometimes throws out error message. Also, it is giving stored events...
Read more >HOW TO: Manually restart the execution of Salesforce platform ...
In order to trigger the process for Msg1, the replayID of previous platform event is required. ... As an alternative to republishing the ......
Read more >How to use IBM App Connect with Salesforce
App Connect has enabled support for the replay ID with Salesforce platform events. This means that if for any reason you had to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This workaround also works for me, thanks @Alasano ! & @karoldylewski Finally I ended up with below code and its working fine with typescript.
Not 100% related but digging through here did allow me to make my pushtopic work in 1.12.2
Connecting in single mode as described in the doc I was getting this error
I replaced the fdcstream.js in the 1.12.2 release with the one from the streaming-2.0 branch and changed the way I subscribe to the pushtopic (passing in /topic/mypushtopic instead of just the topic name, found here https://github.com/kevinohara80/nforce/blob/streaming-2.0/examples/stream.js)
With that I’m able to connect succesfully for the moment. Looking forward to the full 2.0 release, especially the typescript part! Nice work @kevinohara80