Application written in .net tries to read event stream. For this goal, EventStoreCleint wrapper was written, under the hood it uses EventStore.Client.Grpc.Streams 23.1.0. The logic is the following:
- try to read stream
- if there is no stream (or stream version is 0) we can continue and send
TenantCreatedevent - if there is a stream (or stream version is > 0) application will not apply
TenantCreatedevent.
The problem is in fact, when the application reads the event stream by _client.ReadStreamAsync if there is no stream, the exception will be thrown. Exceptions are expensive from the performance point of view.
How to read stream even is stream version is 0 without exceptions?
If you inspect the
StreamStatein the result, it will beStreamNotFoundExample in Equinox
When writing,
ConditionalAppendToStreamAsyncdon't throw an exception either; you inspect theStatusof the result.Example in Equinox