Amazon SQS

Amazon Simple Queue Service (SQS) is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications. SQS eliminates the complexity and overhead associated with managing and operating message-oriented middleware, and empowers developers to focus on differentiating work. Using SQS, you can send, store, and receive messages between software components at any volume, without losing messages or requiring other services to be available.

Prerequisite Tasks

To use these operators, you must do a few things:


Publish a message to an Amazon SQS queue

To publish a message to an Amazon SQS queue you can use the SqsPublishOperator

In the following example, the task publish_to_queue publishes a message containing the task instance and the execution date to a queue with a default name of Airflow-Example-Queue.


publish_to_queue = SqsPublishOperator(
    message_content="{{ task_instance }}-{{ execution_date }}",


Read messages from an Amazon SQS queue

To read messages from an Amazon SQS queue until exhausted use the SqsSensor


read_from_queue = SqsSensor(

Was this entry helpful?