MessagingPlugin(options?: MessagingPluginOptions): IPlugin
MessagingPlugin factory.
Creates a plugin that registers an IMessageBroker implementation based on
the configured backend type. Supports multi-instance deployment via the
name option.
Example 1
Example 1
// Default in-memory broker app.register(MessagingPlugin()); // GCP Pub/Sub app.register(MessagingPlugin({ broker: 'pubsub', projectId: 'my-project', })); // Azure Service Bus app.register(MessagingPlugin({ broker: 'service-bus', connectionString: 'Endpoint=sb://...', })); // Custom broker instance app.register(MessagingPlugin({ broker: 'custom', instance: myCustomBroker, }));
optional
options: MessagingPluginOptions
Plugin configuration options (discriminated union on broker)