property NatsMessagingOptions.streamSubjects
Since 0.5.0

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.

Examples

Example 1

MessagingPlugin({
  broker: 'nats',
  streamSubjects: ['orders.>', 'billing.>'],
});

Type

readonly string[]

Usage

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