[SQSSensor] Add opt-in to disable auto-delete messages#21159
Merged
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)
|
LaPetiteSouris
force-pushed
the
main
branch
2 times, most recently
from
January 27, 2022 16:19
e9f16e2 to
2eb1c99
Compare
jimmytuc
approved these changes
Jan 28, 2022
potiuk
approved these changes
Jan 28, 2022
Contributor
|
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. |
Contributor
Author
|
Awesome work, congrats on your first merged pull request! |
This was referenced Feb 5, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add opt-in in
SQSSensorto 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_receptionisTrue(default): SQS messages are deleted automatically from the queue upon consumption.delete_message_on_receptionisFalse. The user takes care of message deletion manually.Why
In many cases, the
SQSSensoritselft 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
SQSSensorpolls 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.