function EventsMessagingBridge
Since 0.1.0
EventsMessagingBridge(options: EventsMessagingBridgeOptions): IPlugin

EventsMessagingBridge factory.

Creates a plugin that forwards domain events from the in-process event bus to an external messaging broker. This enables local events to be published as cross-service messages without coupling the events and messaging plugins.

The bridge is publish-only: it subscribes to configured event types on the event bus and publishes them to the messaging broker.

Examples

Example 1

app.register(EventsMessagingBridge({
  eventTypes: ['user.created', 'user.updated'],
  topicMapping: (eventType) => `events.${eventType}`,
}));

Parameters

Bridge configuration options

Return Type

IPlugin

A configured IPlugin instance

Usage

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