-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ca59bf
commit 2fc0039
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
2fc0039
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicholasgriffintn , can you please explain why
SQS Consumer does not guarantee FIFO queues will work as expected
? Where (and why) do the FIFO guarantees break?2fc0039
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hasn't been released outside of canary just yet but basically, SQS Consumer is configured to work in a different way to FIFO by default, this means that unless you've configured it in a particular way, you may not get the same FIFO experience.
I haven't thought about what it will take to support FIFO queues, we also don't use them internally, so currently, this message is just there to make it clear that we don't have that guaranteed support, I believe they will still work, however, the experience may not be what you expect depending on your configuration.
2fc0039
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm... @nicholasgriffintn , do you mind explaining a bit more? We do use FIFO and we use
sqs-consumer
where we can't leverage SQS -> Lambda integration. I don't see where sqs-consumer's approach to reading messages breaks FIFO guarantees. You poll. Then you process. Then you delete (acknowledge) on success,. Then you poll again. if you don't delete, you emit an error. FIFO queue will keep the messages for the sameMessageGroupId
unril after the messages it has released have been acknowledged as processed. Where does the guarantee break? I must be missing something... Thanks2fc0039
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well basically because we process in parallel by default rather than in order, which potentially breaks the guarantee of first in, first out if you don't have the correct config.
This is more of a case that makes it clear that we are not actively developing SQS Consumer to work with FIFO (as we don't use it), rather than a specific declaration as to if it does or doesn't work, I actually don't know if it does or doesn't as I don't use FIFO for any implementations.
2fc0039
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicholasgriffintn , I think I know what you mean. If I supply
handleMessage()
, you run those overPromise.all()
vsfor of
. If I supplyhandleMessageBatch()
instead, you hand me the batch (that is ordered) and it's on me to run it in order to keep the FIFO guarantees.I would recommend a few things if I may:
handleMessageBatch()
isFifoQueue
+handleMessage
(vs.handleMessageBatch
)for of
instead ofPromise.all()
when it'sisFifoQueue
? and then no warning needed? 😄Thank you!
p.s. we use
handleMessageBatch()
with our FIFO queues2fc0039
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, thanks for the suggestions, this is actually why I haven't put it further than canary yet.
Using a non parallel loop is a consideration but I'm not sure if we'd do it or not, it's a weigh up between what we need ourselves / the capacity to support, it's difficult to choose to add code that we won't be using ourselves.