Skip to main content
We are subscribing to Push Topics and Platform Events using CometD Subscriber using the code in the EMP Connector provided on GitHub.

Scenario:

Take the case of a subscriber listening on channel /topic/channel. The replayId is -1

Lets say the subscriber received messages upto replayId 20 and then due to some reason the subscriber went down and then came up and started listening on the channel again

In the time the subscriber was down four new events were published. But when the subscriber comes up it will start receiving messages from 25 since the replay id is -1

Question : Is there any way to ensure that the subscriber starts listening from id 21 when it comes up. 

I know that one way is to give the replay id as 21. But that is not suitable for our application

Is there a way to query salesforce through cometD or any SOAP/REST API to check the last received event's replayID and then start the subscriber from that. 

Can we use EventBusSubcriber for this? I started our application and subscribed to a platform event through cometd and tried querying the entries in EventBusSubcriber. But it did not have any entries
2 answers
  1. Jul 8, 2024, 1:59 PM

    Hi ,

     

    I am also facing same issue . Do we have any solution to get the events from last processed event?

     

    Thanks,

    Priyanka

0/9000