Quick expected version query


I’m writing some code to use ES as a queue.

Given that I don’t know how many events will have previously been written to the stream and therefore don’t have an accurate version, am I safe using ExpectedVersion.Any, or will this produce undesired issues later on?

There could be multiple producers writing to the stream at once.

Any help/pointers appreciated.

Kind regards


Do you need any form of concurrency control between the producers?

Hi Greg,

I don't with this particular feature but will later on. How would you manage this?

If you need to manage concurrency between multiple producers, that is
what expected version is for. If you just need to write (say as a
queue) just use expected version any.

Ok, What effect does using ExpectedVersion.Any have internally, is it just the order things are written?

yep exactly