Implement FIFO Support
See original GitHub issueImplement support for FIFO
queues.
Should be pretty straightforward overall. The key part should be implementing a FifoMessageSplitter
with the logic to group messages from the same message group
and processing each group in parallel while maintaining order within a group.
The AbstractEndpoint
should be aware that it’s a fifo
endpoint and instantiate the proper splitter
. Maybe it’s worth having a FifoEndpoint
subclass.
The AsyncMessageSplitter
interface is responsible for splitting the batch of messages acquired from the AsyncMessagePoller
and sending the messages through a processing pipeline provided by the listener container.
@FunctionalInterface
public interface AsyncMessageSplitter<T> {
Collection<CompletableFuture<Void>> splitAndProcess(Collection<Message<T>> messages, Function<Message<T>, CompletableFuture<Void>> processingPipeline);
}
Issue Analytics
- State:
- Created a year ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Amazon SQS FIFO (First-In-First-Out) queues
FIFO (First-In-First-Out) queues have all the capabilities of the standard queues, but are designed to enhance messaging between applications when the order ...
Read more >FIFO (First-In-First-Out) approach in Programming
Disk controllers can use the FIFO as a disk scheduling algorithm to determine the order in which to service disk I/O requests.
Read more >SQS FIFO Queues: Message Ordering and Exactly-Once ...
An SQS FIFO queue is simply a more convenient building block to use in a distributed system aiming at system-wide FIFO message delivery...
Read more >AWS SQS FIFO Queues Simplified: The Ultimate Guide 101
Amazon SQS (Amazon Simple Queuing Service) is a managed message queue service that allows us to create scalable and reliable systems.
Read more >FIFO Support - The GigaSpaces Portfolio
Space Operations. Query Operations with FIFO. To execute read/take operations with FIFO, use the ReadModifiers.FIFO modifier. For example:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
One thing that can be taken under consideration is visibility timeout. In case when one gets 10 messages from same group, they all need to be completed before within the time limit. The idea is to allow to extend the time limit after every message in the group is processed.
The other interesting thing is to decide what to do in case if the message is processed with error. There are few options:
It may happen that some tradeoffs will need to be made and that in order to get expected FIFO semantics, the end user will need to keep batch size set to 1 and perhaps decrease poll timeout (this is how we workaround the lack of FIFO support in Spring SQS today).
IMHO it is bit unfortunate that SQS does not allow to set poll policy to not return multiple messages from same message group as this would allow to parallelize easily (no ordering conflicts in a polled batch)
I’ve created a new issue that makes this scope more clear, so I’m closing this one.
Thanks!
Closed in favor of https://github.com/awspring/spring-cloud-aws/issues/444