Categories
Mastering Development

Sqs sensor in airflow not triggering when there is a new message

I am new to Airflow. I am trying to run my dag whenever there is a message in SQS.
I am using SQSSensor to do the same. It triggered for the first run but after that it doesn’t invoke when there is a new message.

Please let me know if i am missing something.

default_args = {
    'owner': 'Airflow',
    'start_date': days_ago(2),
    'provide_context': True,
}

dag = DAG('sqs_test', default_args=default_args, schedule_interval='@daily')

task = SQSSensor(
    task_id='sqs_test',
    poke_interval=0,
    timeout=10,
    sqs_queue='https://sqs.us-east-1.amazonaws.com/accountid/test',
    aws_conn_id='aws_default',
    max_message=1,
    dag=dag)

Leave a Reply

Your email address will not be published. Required fields are marked *