PubSubPullSensor
GooglePulls messages from a PubSub subscription and passes them through XCom. Always waits for at least one message to be returned from the subscription.
Access Instructions
Install the Google provider package into your Airflow environment.
Import the module into your DAG file and instantiate it with your desired params.
Parameters
Documentation
Pulls messages from a PubSub subscription and passes them through XCom. Always waits for at least one message to be returned from the subscription.
See also
For more information on how to use this operator, take a look at the guide: Pulling messages from a PubSub subscription
See also
If you don’t want to wait for at least one message to come, use Operator instead: PubSubPullOperator
This sensor operator will pull up to max_messages
messages from the specified PubSub subscription. When the subscription returns messages, the poke method’s criteria will be fulfilled and the messages will be returned from the operator and passed through XCom for downstream tasks.
If ack_messages
is set to True, messages will be immediately acknowledged before being returned, otherwise, downstream tasks will be responsible for acknowledging them.
If you want a non-blocking task that does not to wait for messages, please use PubSubPullOperator
instead.
project_id
and subscription
are templated so you can use variables in them.