-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Feature Request
Use Case:
The motivation comes from event sourcing-style use cases, but can apply to general sourcing of a stream into some materialized form.
Event sourcing is a persistence model where events are the source of truth and all state materializations are derived. What this means for NATS is that consumers are created and named corresponding to these materializations. Additionally, it is common for these consumers to only target subset of a stream (subject filter applied).
For one-off cases, an ephemeral consumer works great. For larger or persisted materializations, a durable will be used. Since these materialized views can be thrown away, rebuilt, etc. after bugs are found, materialization logic is changed, etc it is common that a consumer will need to be reset the sequence to the initial message to replay from the start of the stream to rebuild this view.
The start sequence may need to be reset to the original first event, or if snapshots are being used, it may need to be reset to an arbitrary sequence relative to that snapshot.
Proposed Change:
The ability to dynamically reset/change the start sequence on a consumer.
Who Benefits From The Change(s)?
Anyone wanting to reset the sequence on a consumer (event sourcing or not).
Alternative Approaches
Today, the consumer start sequence cannot be changed, so to achieve this behavior, the consumer has to be deleted and then recreated with the same name.