Plugin configuration options (discriminated union on broker)
A configured IPlugin instance
// 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,
}));
MessagingPlugin factory.
Creates a plugin that registers an IMessageBroker implementation based on the configured backend type. Supports multi-instance deployment via the
nameoption.