method IPubSubTransport.open
IPubSubTransport.open(
topic: string,
subscription: string,
onMessage: (msg: { payload: string; ack: () => void; nack: () => void; attributes?: Readonly<Record<string, string>>; messageId?: string; timestamp?: Date; }) => void
): Promise<IPubSubSubscription>

Open a subscription on a topic. Creates the subscription when absent.

Parameters

topic: string
subscription: string
onMessage: (msg: { payload: string; ack: () => void; nack: () => void; attributes?: Readonly<Record<string, string>>; messageId?: string; timestamp?: Date; }) => void

Called per delivered message

Return Type

Usage

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