Closed danieljelder closed 1 year ago
We've worked around this limitation via reflection, but it would indeed be nice to get the ability to access the value directly.
@danieljelder @jezovuk Could you share what you do with a raw integer value? Because the library never used raw integers for expected version.
@YoEight apologies, I got two versions of our code confused.
In our latest code using v3.0.2
, we use WriteResult.getNextExpectedRevision().getValueUnsigned()
.
@danieljelder what do you do with that unsigned integer?
The caller uses the version to check if the read model has updated before performing other operations that may rely on it.
If that's something you don't persist, the new type does implement equals
properly. I could also add a compare
function too. If it's not enough, I could also add a method that returns a raw integer representation.
The raw integer representation would be great, as the value is passed between services so we can't use comparisons on the class.
Hi,
We are currently at client version 3.0.2.
When performing an appendToStream, we get a write result back which contains a nextExpectedVersion, which is a long. The caller then receives this version, and we regularly use it to poll the read model to check when it’s available.
I have been experimenting a bit with client version 4.1.1 to see what changes need to be made. I noticed there isn’t a nextExpectedVersion anymore.
Instead there’s a nextExpectedRevision, but this is an abstract class of ExpectedRevision. One of the subclasses is a SpecificExpectedRevision, but that isn’t public, and so we can’t extract the version from that.
Would it be possible to expose the revision number?