NATS JetStream message broker implementation.
Creates a new NATS broker.
serializer: ISerializer
Serializer for message payloads
options: NatsOptions
NATS connection and configuration options
connect(): Promise<void>
Connects to NATS and ensures the JetStream stream exists.
disconnect(): Promise<void>
Disconnects from NATS.
isHealthy(): Promise<boolean>
Boolean port member (M70c): false only when positively unreachable.
isReady(): boolean
Checks if the broker is connected.
publish<T>(topic: string,message: T): Promise<void>
Publishes a message to a subject (topic).
publishWithHeaders<T>(topic: string,message: T,headers: Readonly<Record<string, string>>): Promise<void>
Publishes a message with framework-owned transport headers. @internal
reachability(): Promise<boolean | undefined>
Tri-state backend reachability (M70c).
nats reconnects itself, so the broker runs the supervisor in observe
mode: Disconnect/Reconnect events mark the fault window, and the
probe is isClosed() === false and rtt() resolving. true when
both hold, false when the window is active or the connection reports
closed, undefined when the injected client exposes neither member (a
minimal fake) — the indicator then reports reachable: 'unknown'.
request<TReq, TRes>(): Promise<TRes>
Sends a request and awaits a single correlated reply.
requestWithHeaders<TReq, TRes>(): Promise<TRes>
Sends request-reply traffic with framework-owned headers. @internal
respond<TReq, TRes>(): Promise<ISubscription>
Registers a responder whose result is returned to the requesting caller.
subscribe<T>(): Promise<ISubscription>
Subscribes to a topic using JetStream durable consumers.
subscribeWithHeaders<T>(): Promise<ISubscription>
Subscribes through the header-aware internal path. @internal