Add :nack strategy#86
Merged
josevalim merged 2 commits intoMay 30, 2025
Merged
Conversation
582797e to
d7871d2
Compare
With the ack option `{:nack, timeout}`, add support for "nack"ing SQS messages (setting visibility timeout to some point in the future)
d7871d2 to
dd0ea5a
Compare
josevalim
reviewed
May 30, 2025
Comment on lines
+45
to
+46
| collect_messages_to_nack(successful, ack_options, :on_success) ++ | ||
| collect_messages_to_nack(failed, ack_options, :on_failure) |
Contributor
There was a problem hiding this comment.
Can we write it in the same style as above for consistency?
Suggested change
| collect_messages_to_nack(successful, ack_options, :on_success) ++ | |
| collect_messages_to_nack(failed, ack_options, :on_failure) | |
| Enum.flat_map(successful, &nack(&1, ack_options, :on_success)) ++ | |
| Enum.flat_map(failed, &nack(&1, ack_options, :on_failure)) |
And then nack either returns an empty list or a single element list with message and timeout. :)
dd0ea5a to
b954dd5
Compare
b954dd5 to
6b3e466
Compare
Contributor
Author
|
@josevalim Good call! Addressed in 6b3e466 Verified by starting a Broadway pipeline with |
Contributor
|
💚 💙 💜 💛 ❤️ |
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.
Hey team! This PR introduces a new
:nackacknowledgement mode for BroadwaySQS.The client now supports changing message visibility in addition to deleting messages, with batch requests to SQS.
{:nack, timeout}can be used for:on_successor:on_failure, validated by a new custom option type.Producer documentation explains the behavior, and tests cover the updated logic.
Let me know what you think! Happy to change the name or interface for this option.