Study FAQ
How do I make a Dataverse event consumer safe to restart or replay?
Also asked as 2
- How can a webhook or Service Bus consumer avoid duplicate business effects from Dataverse events?
- What should a Dataverse event consumer record before acknowledging work?
Answer
Make the Dataverse event consumer durably record accepted work and use a stable identity to prevent duplicate business effects. An asynchronous webhook receiver can validate and persist work before returning HTTP success. A Service Bus consumer should coordinate its effect record and settlement so a stop after the effect but before acknowledgement remains recoverable.
Choose the identity for the actual effect. A projection that refreshes current state can coalesce events by row, provided an older concurrent read cannot overwrite a newer projection. An irreversible action per transition needs a durable, unique business-effect identity and an atomic uniqueness decision where the effect is applied. A Dataverse correlation ID helps join diagnostics across work, and a row ID alone cannot identify several effects for that row.
Record accepted identity, schema version, safe payload fingerprint, processing state, and attempts. Use the original identity for authorized replay and capture its reason. Handle invalid context explicitly and use the selected transport's supported reprocessing or dead-letter process. A receiver restart or broker retry should leave one intended effect.
Test duplicate input and a controlled stop between durable intake, processing, and acknowledgement. Check the work record and external destination, including any malformed messages set aside for investigation.
Microsoft references
Full explanation
AB-400: Publishing Dataverse Events to External Services
Study guide · AB-400
Read the full explanation