
Consume
Requires a maxDuration or a maxRecords.
Requires a maxDuration or a maxRecords.
Consume messages from a Google Pub/Sub topic.
Requires a maxDuration or a maxRecords.
type: "io.kestra.plugin.gcp.pubsub.Consume"Examples
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
The Pub/Sub subscription.
The Pub/Sub subscription. It will be created automatically if it didn't exist and 'autoCreateSubscription' is enabled.
topic*Requiredstring
The Pub/Sub topic
The Pub/Sub topic. It must be created before executing the task.
autoCreateSubscriptionbooleanstring
trueWhether the Pub/Sub subscription should be created if not exists.
impersonatedServiceAccountstring
The GCP service account to impersonate.
maxDurationstring
durationMax duration in the Duration ISO format, after that the task will end.
maxRecordsintegerstring
Max number of records, when reached the task will end.
projectIdstring
The GCP project ID.
scopesarray
["https://www.googleapis.com/auth/cloud-platform"]The GCP scopes to be used.
serdeTypestring
STRINGSTRINGJSONThe serializer/deserializer to use.
serviceAccountstring
The GCP service account.
Outputs
countinteger
Number of consumed rows.
uristring
uriFile URI containing consumed messages.
Metrics
recordscounter
recordsNumber of records consumed from the Pub/Sub topic.