3
votes

I understand the CommitId is used internally by Jonathan Oliver's event store. So far I've always provided a Guid.NewGuid() for the CommitId.

When would you every want to do anything different?

I don't understand why it is exposed within his common domain Repository.

Can anyone can shed some light on this?

1
Good question; I can answer it (to allow competing writers who have a shared identifier such as a Command Id) to more cheaply induce fail fast idempotency behavior in the Commit process.Ruben Bartelink
Thanks Ruben. For those who want to dig into this try here: docs.geteventstore.com/dotnet-api/3.6.0/…andrew pate

1 Answers

3
votes

In general, CommonDomain doesn't try to force a one-size-fits-all opinionated structure.

One way to leverage it is by having writers use their unique incoming Command Id as a CommitId - this means that competing (or retries competing with runs that have yet to time out) will get rejected with a specific exception without needing to enter into/consider/manage Conflict Resolution logic. This is used to fulfil the key tenet of Idempotent Commands.