> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Cloud Pub/Sub

> Pull and acknowledge a Pub/Sub subscription and publish to a topic over HTTPS.

Use [the Streams mount example](https://docs.bijection.com/integrations/native-kinesis.md) with
`pubSubReceiver("example-project", "orders-subscription", "orders-topic", auth, data)`
and bind it to `streams_pubsub`. The receiver fixes the subscription
and publish topic under `https://pubsub.googleapis.com`. Use a sealed bearer
token or OAuth2 with a sealed refresh token and Google's
`https://oauth2.googleapis.com/token` endpoint. Grant the principal consume
rights on the subscription and publish rights on the topic. Use matching
[labels](https://docs.bijection.com/integrations/native-connectors.md#installer-bound-labels) and call
`streams.pubsub.initialize({})`. Use a fresh mount for a different
subscription or topic incarnation.

One REST pull returns at most one message. The app retains up to 16 KiB
of decoded body in a File and up to 4 KiB of attributes and other metadata.
The topic's `messageId` identifies the event. The landing commit
retains the event and admits `Acknowledge` for the current `ackId`.
An expired acknowledgement can yield a redelivery with a new token.
Configure the subscription's acknowledgement deadline to allow time for
the commit and dispatch. Invalid or oversized deliveries remain
unacknowledged. The subscription owns its delivery position and retention.
The app retains events when the remote delivery is settled or expires.

Call `publish({ command, message })` to send a nonempty UTF-8 message of up
to 16 KiB. The host sends each task at most once. Repeating an identical
command recovers its retained disposition.
`publishStatus({ command })` reports the provider-assigned message ID on
acceptance. An ambiguous send stays unknown.

See [Pull](https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/pull)
and [Publish](https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/publish).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.