
Google Cloud Consume
CertifiedConsume messages from Pub/Sub
Google Cloud Consume
Consume messages from Pub/Sub
Pulls messages from a subscription until maxRecords or maxDuration is reached. Writes messages to a Kestra storage file and acks them.
type: io.kestra.plugin.gcp.pubsub.ConsumeExamples
id: gcp_pubsub_consume
namespace: company.team
tasks:
- id: consume
type: io.kestra.plugin.gcp.pubsub.Consume
topic: topic-test
maxRecords: 10
projectId: {{ secret('GCP_PROJECT_ID') }}
subscription: my-subscription
Properties
subscription *Requiredstring
Subscription
Subscription name; auto-created when autoCreateSubscription is true
topic *Requiredstring
Topic name
Pub/Sub topic ID (without project prefix)
autoCreateSubscription booleanstring
trueAuto-create subscription
Create the subscription if missing; default true
impersonatedServiceAccount string
The GCP service account to impersonate
maxDuration string
Max duration
Duration limit (ISO-8601); stop when reached
maxRecords integerstring
Max records
Stop after this many messages
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
projectId string
The GCP project ID
scopes array
["https://www.googleapis.com/auth/cloud-platform"]The GCP scopes to be used
serdeType string
STRINGSTRINGJSONSerde type
Serializer/deserializer for message payloads; defaults to STRING
serviceAccount string
The GCP service account
Outputs
count integer
Consumed message count
uri string
uriMessages file URI
Kestra storage URI of the file containing consumed messages
Metrics
records counter
recordsNumber of records consumed from the Pub/Sub topic.