Open jezovuk opened 6 years ago
This is mostly problematic in testing/debugging while real-life use is ok as long as UUIDConverter methods for converting UUID to/from byte array are simmetric.
Not if you want to add your own UUID to an event like
EventData event = EventData.newBuilder()
.eventId(UUID.randomUUID())
.type("event0")
.data(new byte[3])
.metadata(new byte[2])
.build();
I fixed this with the help of @bremm in #41
In
com.github.msemys.esjc.util.UUIDConverter.toBytes()
UUID is converter to byte array directly, while .NETGuid
does some inversion. See:As a consequence, if eventId is hard-coded to some UUID (read from string) and such event is saved to event store, EventStore will report a different EventId (string) value (consistent with different byte ordering).
As an example, Java UUID
92651dfa-0d83-53e2-a6f7-e6afad26121e
will be shown asfa1d6592-830d-e253-a6f7-e6afad26121e
in EventStore (when EventId is checked via EventStore HTTP API).This is mostly problematic in testing/debugging while real-life use is ok as long as
UUIDConverter
methods for converting UUID to/from byte array are simmetric.