• Raghuveer Mukkamalla 14
  • NEWBIE
  • 35 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
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
I get the following message trying to install the DreamHouse app:
This app can't be installed.
There are problems that prevent this package from being installed.
Custom Field Definitions(00N6A0000098lS8) Duplicate RelationshipNameThe relationship name "Favorites__r" is already used by custom field Favorite__c.Property__c. Please rename existing relationship name.

How do I fix this?
Thanks,
Eddie