Setu-TS
    Preparing search index...

    Class GcpPubSubBroker

    GCP Pub/Sub message broker.

    0.1.0

    Implements

    • MessageBrokerAdapter
    Index
    • Boolean port member (M70c): false only when positively unreachable.

      Returns Promise<boolean>

      true when reachable or unprobeable, false when the transport reports unreachable

      0.1.0

    • Publishes a payload under the configured acknowledgement bound.

      Type Parameters

      • T

      Parameters

      • topic: string

        Destination topic

      • message: T

        Payload to serialize

      • Optionaloptions: PublishOptions

        Caller headers, ordering key and de-duplication id

      Returns Promise<void>

      Resolves when Pub/Sub acknowledges the publish

      When publishTimeoutMs expires; delivery remains possible

      0.1.0

    • Internal

      Publishes with framework-owned headers under the configured acknowledgement bound.

      Type Parameters

      • T

      Parameters

      • topic: string

        Destination topic

      • message: T

        Payload to serialize

      • headers: Readonly<Record<string, string>>

        Framework-owned transport headers

      • Optionaloptions: PublishOptions

        Caller headers, ordering key and de-duplication id

      Returns Promise<void>

      Resolves when the transport acknowledges the publish

      When publishTimeoutMs expires; delivery remains possible

    • Tri-state backend reachability (M70c).

      The GCP SDK owns streaming-pull reconnection, so the broker issues no reconnect loop of its own. The transport's isHealthy round trip is cached for 5 s and bounded at 2 s. The real adapter uses getTopics: gRPC 14 → false, 4 → undefined, other numeric codes → true, no code → false. An expired bound or an absent transport probe means unknown reachability.

      Returns Promise<boolean | undefined>

      true/false/undefined as described

      0.1.0

    • Sends a request to a topic and awaits a single correlated reply, providing brokered request-reply (RPC) over the message broker.

      A responder registered with respond on the same topic returns the reply. The call rejects with a RequestTimeoutError when no reply arrives within options.timeoutMs, and with a RemoteHandlerError when the responder throws.

      Request traffic rides a channel derived from topic, disjoint from plain publish/subscribe on that same topic — a pub/sub consumer never observes an RPC request, and vice versa.

      Type Parameters

      • TReq

        The request payload type

      • TRes

        The reply payload type

      Parameters

      • topic: string

        Destination topic the responder is listening on

      • message: TReq

        The request payload (serialized by the broker adapter)

      • Optionaloptions: RequestOptions

        Reply timeout behavior

      Returns Promise<TRes>

      The reply payload