interface InMemoryBrokerOptions
Since 0.4.0

Options for the in-memory broker — the adapter behind the memory arm of MessagingPluginOptions, constructed by it and by applications that build InMemoryBroker directly.

Properties

readonly
optional
onDispatchError: (
error: unknown,
metadata: MessageMetadata
) => void | Promise<void>

Called once per REJECTED subscription handler, with the error and the message metadata of the failed dispatch. publish resolves on dispatch hand-off — never on handler completion — so this reporter is the terminus of the broker's failure path: the in-memory broker has no ack model and no redelivery to fall back on (unlike RabbitMQ, where a rejection reaching the broker's failure path can nack and redeliver). Absent, the rejection is still observed and settled — never an unhandled rejection — then dropped. A reporter that itself throws or rejects is swallowed by the broker: it is the last-resort sink, so its own failure can neither reject publish nor abort the sibling fan-out nor surface as an unhandled rejection. MessagingPlugin always supplies one backed by the application's logger, so the absent case is reachable only by constructing the broker directly.

Usage

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