Hello,
I would like to know if there is a way, when creating a stream, to specify the offset that is going to be assigned to the first message published to a stream.
This is important for us, because we track our position in the stream through offsets (though those offsets are persisted in the DB). We also have data integrity checks that verify that every message that is applied to an entity has been published after the previous message that was already applied to this entity. We do this by comparing offsets.
However, this whole mechanism breaks down if for whatever reason (operating error, hardware crash, migrating the streams to a different RMQ cluster, etc..), the stream has to be re-created. If we do this and the offset of the new streams are reset to 0, all our integrity checks will fail, and our systems will basically be dead in the water.
I looked in the documentation, but could not find any reference to a queue argument that could be used to set the initial message offset of a stream. Does this exist?
We could implement a workaround on our side by tracking (streamVersion, offset) where streamVersion is incremented each time we handle a message with offset 0, but it seems somewhat brittle and adds some extra complexity that we would rather avoid, if possible.
Thanks for your help,
Nicolas Piguet