question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement FIFO Support

See original GitHub issue

Implement 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:closed
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
mgusiew-guidecommented, Jun 30, 2022

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:

  1. Process next messages in group
  2. Retry the error message (possibly with extending timeout on all of messages in the group)
  3. Let the messages return to queue (no ack) - the problem here is that until few retries the messages may land up in DLQ even though they were not ever processed (because of poison message in front)

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)

0reactions
tomazfernandescommented, Jul 1, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found