Skip to content

docs: DeferMessageAction on SQS FIFO preserves group order - #209

Merged
iancooper merged 5 commits into
BrighterCommand:masterfrom
calebkoy:docs/defer-sqs-fifo-ordering
Nov 9, 2026
Merged

iancooper merged 5 commits into
BrighterCommand:masterfrom
calebkoy:docs/defer-sqs-fifo-ordering

Conversation

@calebkoy

@calebkoy calebkoy commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

HandlerFailure.md says DeferMessageAction will de-order the message. On SQS it does not. Defer calls ChangeMessageVisibility on the same in-flight message (Proactor.RequeueMessage -> SqsMessageConsumer.RequeueAsync), so message ID, group ID and dedup ID are unchanged.

On a FIFO queue, later messages in the same group stay unavailable until the delay ends, so order within the group is preserved; other groups keep flowing.

Adds a short 'Exception: AWS SQS' paragraph and links to Ack and Nack in AWSSQSConfiguration.md. Existing sentence left unchanged (other transports not checked).

Comment thread contents/HandlerFailure.md Outdated

`DeferMessageAction` will de-order the message. This means you cannot rely on the order of messages in the channel. Either, your message must be able to processed independently of the others, or you must use a strategy to process out-of-order. For example you may add a version stamp to the message and only applying it if you have not already processed a later message.

**Exception: AWS SQS.** On SQS, a deferred message is not re-published. Brighter calls `ChangeMessageVisibility` on the same in-flight message, so the message ID, message group ID and deduplication ID do not change. On an SQS FIFO queue, SQS does not deliver later messages from the same message group while the deferred message is invisible, so order within the group is preserved. The group is blocked until the delay ends; other message groups keep flowing. On a standard SQS queue there is no ordering to preserve. See [Ack and Nack](/contents/AWSSQSConfiguration.md#ack-and-nack) for how requeue is implemented.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, if you look further up, it indicates that DeferMessageAction will use the scheduler. This is not true for SQS, which uses visibility. It's also not entirely true for RMQ and AWS, which use non-scheduler-based retry mechanisms. Those will (I think), however, de-order

What we may need is a table that indicates:

Broker
Defer Message Uses
Ordering

You can have an entry for "All Others" that just says "Scheduler" and "Deorders" and then add the entries for SQS, RMQ and ADB

@calebkoy calebkoy Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @iancooper - agreed.

@guilhermeappel got there before me and I see the table is coming in #217

I've included the BufferSize limit note from your testing. Are we happy to merge this PR in and then the end state with the table follows in Guilherme's PR?

iancooper pushed a commit that referenced this pull request Nov 7, 2026
…rdering

HandlerFailure.md said a defer goes through a scheduler and de-orders
the message, which isn't true on every transport. Ian suggested a table
in PR #209, so the page now has one, and the two sentences that said so
point to it.

Part of issue #208.
@iancooper

Copy link
Copy Markdown
Member

@calebkoy I think this works better as part of the table. Now I have merged that, could you take a look at that approach

@calebkoy

calebkoy commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

@calebkoy I think this works better as part of the table. Now I have merged that, could you take a look at that approach

@iancooper done in 8b6d00d

@iancooper

Copy link
Copy Markdown
Member

Thanks @calebkoy

@iancooper
iancooper merged commit d248df5 into BrighterCommand:master Nov 9, 2026
5 of 6 checks passed
@calebkoy
calebkoy deleted the docs/defer-sqs-fifo-ordering branch November 9, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants