interface NatsMessagingOptions
Since 0.1.0

NATS arm.

Properties

broker: "nats"
optional
url: string
optional
client: INatsConnection

Factory building the NATS MsgHdrs used to carry transport headers.

Required alongside client for trace propagation: an injected connection carries no nats module, so the broker has no headers() to call. A lazily-loaded connection supplies its own and needs nothing here.

optional
streamName: string
Since 0.5.0
optional
streamSubjects: readonly string[]

Subjects the broker may create streamName with when the stream is absent on the server.

There is deliberately NO default and no catch-all: NATS refuses a stream capturing every subject unless it is created with no_ack: true, and no_ack makes every JetStream publish reject unobserved (X28-2). Supplied and the stream is absent → the broker creates it with exactly these subjects. Absent and the stream is absent → startup rejects with JetStreamStreamError, naming the stream and both remedies (create the stream out of band, or supply this option). An existing stream is never touched either way.

optional
defaultQueue: string

Usage

import { type NatsMessagingOptions } from "messaging-plugin/src/index.ts";