-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
SQS Listner for SQS FIFO Queue is sending all messages concurrently, FIFO not followed. AWSPRING Cloud version 3.0.2 #892
Comments
Hi @nikhilznr. You can add a breakpoint to FifoSqsComponentFactory.java and MessageGroupingSinkAdapter.java if you'd like to debug this further. Now, this use of Project Reactor is not compatible with this kind of Listener method. When you subscribe to your reactive chain, the listener thread will be released and the flow will go on to the other components such as error handling, interceptors and back pressure release before the message is actually processed, triggering a potentially unbounded polling loop that might lead to issues such as OOM. We don't officially support Project Reactor in this project, but you could try creating some kind of adapter to turn your Does this make sense? If you'd like me to take a closer look, please provide a minimal sample project that reproduces the issue. Thanks. |
@tomazfernandes We observed the same behavior as OP without using Reactor (although OP uses it in a synchronous way). According to our experiments it happens when maxMessagesPerPoll << maxConcurrentMessages. E.g. when maxMessagesPerPoll=1 and maxConcurrentMessages=10 the FIFO order is violated. When maxMessagesPerPoll=10 and maxConcurrentMessages=10 - seemingly not. The acknowledgement mode seems to have no influence on this behavior - we saw it in both manual and automated modes. |
We fixed the issue by adding custom / non zero value of messageVisibilitySeconds in @SqsListener I think by default, 0 gets sent. |
Hi @K2CO3, thanks for bringing this up, and thanks @nikhilznr for showing up again. Just to get this out of the way - are you testing against AWS, or LocalStack? LocalStack had a quite flaky FIFO implementation last time I checked.
This would be curious, because since we're fetching one message per poll,
If that was the case and we were overriding the queues' default visibility with a zero visibility it might indeed cause this issue. Now, in all of my tests, when the annotation does not provide a value and no value is configured in the
I don't think we can affirm that without looking at the rest of the code - unless I'm missing something, the first I/O the logic encounters it'll hop to a different thread and release the subscribing thread. If you could provide a sample application that can consistently reproduce the issue against AWS it would help me take a closer look into this. Thanks. |
Closing due to lack of feedback. We can reopen if necessary. |
Type: Bug
Component:
SQS
Describe the bug
SQS listener for SQS FIFO queue is sending all messages concurrently instead of one by one per messageGroupId.
Sample
The text was updated successfully, but these errors were encountered: