Difference between revision argument for reading and subscribing

Is it correct that the starting revision argument is inclusive for reading but exclusive for subscribing? Also: If it is inclusive for reading, what is the difference between a starting revision of 0 and an empty one (as in omitting the argument)?

You are right. When reading, you want to read from X onwards, including X. When subscribing, you usually store the last processed event revision as the checkpoint and you don’t want to process this event again, so the subscription will start with X+1.

When subscribing to streams, not specifying the position would give you all events from now, not from the start of the stream.

1 Like

Thanks for the confirmation!

My second question was only about reading, not subscribing. From what I can tell, reading from a stream without specifying a revision will yield all events in the stream. As reading revisions are inclusive, passing a zero as starting revision will result in the same. Therefore, I was just wondering whether there is any difference between the two.

Yeah, I think it’s the same. Basically, the API suggests “I want to read the whole stream”.

1 Like