Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Support a pre-existing JetStream stream for events #8

@autodidaddict

Description

@autodidaddict
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions