-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SQSSensor] Add opt-in to disable auto-delete messages #21159
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
e9f16e2
to
2eb1c99
Compare
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease. |
Awesome work, congrats on your first merged pull request! |
What
Add opt-in in
SQSSensor
to disable the behavior of automatically delete messages on consumption. This option is opt-in. By default it is set toFalse
, which means the original feature is preserved.delete_message_on_reception
isTrue
(default): SQS messages are deleted automatically from the queue upon consumption.delete_message_on_reception
isFalse
. The user takes care of message deletion manually.Why
In many cases, the
SQSSensor
itselft is not the part of the code base that actually processes the messages. It serves as a short of polling to get messages out for further processing.If the actually code/Aiflow task that processes the messages failed, the message should be put back in the queue for further processing. This is the very basic idea of SQS Polling provided by Amazon.
Reference to SQS with AWS Lambda function, AWS docs states :
In many case, the
SQSSensor
polls the message and distributes the workload to different task, in a very similar way to AWS Lambda polling.Thus, there should be option to disable to default behavior, which is to delete the message upon reception.