This page contains code samples for Pub/Sub Lite. To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.
Publish with ordering keys
Publish messages with an ordering key. Ordering keys are hashed to map to a partition. Messages of the same ordering key get published to the same partition. If the partition is filled up, oldest messages get written over.
Stream Pub/Sub Lite to Cloud Storage using Dataflow
This sample shows how to create an Apache Beam streaming pipeline that reads messages from Pub/Sub Lite, group the messages using a fixed-sized windowing function, and writes them to Cloud Storage.
View in documentation