The following new options should be made available for starting a lattice observer:
Stream name - The name of a pre-existing stream, observer should assume this contains cloudevents from a wasmbus event stream.
JS domain - JetStream domain of the pre-existing stream
Snapshot every N - Indicates the observer should emit a snapshot event (which will purge pre-existing events from the stream) after every n events.
Snapshot every Mins - Indicates the observer should emit a snapshot event after every n minutes. This option is mutually exclusive with the previous option.
When an observer starts, it will:
Create an ephemeral consumer for the indicated stream (if one is provided)
Read stored events until NATS indicates the pending event count in the stream is 0.
Stop the replay subscription when the event pending count from NATS is 0.
Ignore all snapshot instructions during replay
The net result of these changes will make it so that, in the presence of a JetStream event stream for wasmbus.evt.* events, an observer can start at any time and automatically catch up, generating accurate state. It can also short-cut the amount of events it needs to read upon replay through the addition of a new cloud event, the lattice_snapshot_created event.
n
events.n
minutes. This option is mutually exclusive with the previous option.0
.The net result of these changes will make it so that, in the presence of a JetStream event stream for
wasmbus.evt.*
events, an observer can start at any time and automatically catch up, generating accurate state. It can also short-cut the amount of events it needs to read upon replay through the addition of a new cloud event, thelattice_snapshot_created
event.