Architecture Decision Record

ADR-0030: Durable Consumers Are Named Infrastructure, Not Ephemeral Session State

Status: Accepted · Date: 2026-03-06

Status: Accepted

Date: 2026-03-06

Context

BSFG already chose unary paged pull and durable named consumers for fetch progress. JetStream consumers are the mechanism that track delivery and acknowledgement state, and durable consumers persist that progress across disconnects and restarts. NATS also documents that pull consumers are intended for batching and horizontal scaling, and that streams and durable consumers can be managed administratively outside the application. :contentReference[oaicite:0]{index=0}

That leaves one architectural question: should BSFG consumer identities be treated as ephemeral runtime artifacts created freely by sessions, or as named infrastructure objects with governed lifecycle?

Options Considered

Option Description Benefits Drawbacks
Ephemeral session consumers Create consumers on demand per client session or replication loop instance.

|

| | Application-managed durable consumers only | Let each runtime create and own durable consumers programmatically as needed. |

|

| | Named infrastructure consumers (Selected) | Treat durable consumers as governed infrastructure objects with stable names and lifecycle. |

|

| | Raw stream position without consumer identity | Skip consumer abstractions and track offsets entirely outside JetStream. |

|

|

Decision

BSFG treats durable consumers as named infrastructure, not ephemeral session state.

consumer_name = stable logical reader identity
progress      = persisted server-side
lifecycle     = governed operationally

Practical implications:

Durable consumers may still be created programmatically, but they are part of infrastructure topology, not casual per-session runtime noise. NATS explicitly documents durable consumers as persistent stateful views and notes that they can be managed administratively outside the application. :contentReference[oaicite:1]{index=1}

Consequences

Benefits:

Tradeoffs: