Since there is no standard documentation on this, I'm willing to know how would platform events deal with:
- Duplicate Messages (Due to multiple triggers on the same record).
- Out Of Order Delivery.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
This is an application design question. If multiple consumers for the same event try and CRUD the same Sobjects, then Upsert should be used and you may easily encounter locking issues. If multiple consumers for the same event do callouts, then either the remote system needs to be idempotent or you have to persist the Platform Events to sobjects with some logic to see if some key has already been used in the callout.
Out of order delivery
Platform Events are consumed in the order published. The ReplayId field is an ascending integer.