property MessagingCommonOptions.subscriptions
Since 0.3.0

Subscriptions registered declaratively, as an alternative to calling broker.subscribe(topic, handler, options) imperatively after start(). Each entry — instance or RegistryFactory — produces one subscribe() call, so a subscription can be declared where the plugin is composed instead of after the application has started.

Instance entries register during the plugin's register() phase, identical to the imperative timing. Factory entries are resolved in the onInit phase — the first at which the registry holds every capability — and the plugin AWAITS each subscribe() there, so the subscription is established before the application serves. A factory that throws rejects start() with an error naming MessagingPlugin({ subscriptions }) and the entry's index in THIS declared array, not its position among the factories.

Because the arm sits on this shared interface, EVERY MessagingPluginOptions union arm inherits it — the declarative form is broker-agnostic, exactly like the imperative subscribe() it mirrors.

Type

readonly SubscriptionEntry[]

Usage

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