expectedVersionwhen posting event batches. When creating a new Aggregate the field should be set to
0to guarantee that no previous events have been stored for that id.
aggregateVersion. That number is what you are supposed to use as the
expectedVersionin your next Aggregate update. If the Aggregate was updated by some other process concurrently, ie. the server-side version check fails, you will get a HTTP 409 (Conflict) response back. You will then have to load the Aggregate once again, re-apply your change and try to save it again.