interface IPubSubTransport

Domain port for GCP Pub/Sub operations. The broker depends on this, not the SDK directly.

Methods

publish(
topic: string,
bytes: Uint8Array,
attributes?: Readonly<Record<string, string>>
): Promise<void>

Publish bytes to a topic.

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.

createSubscription(
topic: string,
subscription: string
): Promise<void>

Explicitly create a subscription (for RPC inbox).

deleteSubscription(subscription: string): Promise<void>

Delete a subscription (for RPC inbox teardown).

close(): Promise<void>

Close the client and all subscriptions.

optional
isHealthy(): Promise<boolean>

Reports whether the Pub/Sub backend is reachable (optional, M70c).

The real adapter calls the SDK's topic.exists(); a transport without a liveness check omits it and the broker reports unknown reachability. The SDK owns streaming-pull reconnection, so the broker issues no reconnect loop of its own.

Usage

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