From a0314adb16c0f7ad8e96b9c8e8f8395af7481856 Mon Sep 17 00:00:00 2001 From: calebkoy Date: Fri, 30 Oct 2026 16:08:54 +0000 Subject: [PATCH 1/3] docs: DeferMessageAction on SQS FIFO preserves group order --- contents/HandlerFailure.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contents/HandlerFailure.md b/contents/HandlerFailure.md index 82ea88e..e73a9c7 100644 --- a/contents/HandlerFailure.md +++ b/contents/HandlerFailure.md @@ -87,6 +87,8 @@ However, if you don't want to block the thread throwing `DeferMessageAction` wil `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. + A useful rule of thumb is: * **Queue**: You can use `DeferMessageAction` without other design decisions, as items on the queue are not ordered. From 687a737c280576b9c18c31b9e28b8d3b18fc2870 Mon Sep 17 00:00:00 2001 From: "caleb.owusuyianoma" Date: Fri, 6 Nov 2026 10:29:50 +0000 Subject: [PATCH 2/3] docs: DeferMessageAction on SQS FIFO keeps group order only at BufferSize 1 --- contents/HandlerFailure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contents/HandlerFailure.md b/contents/HandlerFailure.md index 7737fae..8830b88 100644 --- a/contents/HandlerFailure.md +++ b/contents/HandlerFailure.md @@ -87,7 +87,7 @@ However, if you don't want to block the thread throwing `DeferMessageAction` wil `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. +**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 when `BufferSize` is 1, the default, and the group is blocked until the delay ends; other message groups keep flowing. With a `BufferSize` above 1, messages of the group that were already fetched still run while the deferred one waits. 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. A useful rule of thumb is: From 8b6d00d76050b7207f575c6da2beced29de675c8 Mon Sep 17 00:00:00 2001 From: "caleb.owusuyianoma" Date: Mon, 9 Nov 2026 12:30:35 +0000 Subject: [PATCH 3/3] docs: fold the SQS defer exception into the table --- contents/HandlerFailure.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/contents/HandlerFailure.md b/contents/HandlerFailure.md index a884b48..0b52f35 100644 --- a/contents/HandlerFailure.md +++ b/contents/HandlerFailure.md @@ -89,7 +89,7 @@ What a defer does to the message, and so to its order, depends on the transport: | Broker | Defer Message Uses | Ordering | |--------|--------------------|----------| -| AWS SQS | `ChangeMessageVisibility` on the same message, no scheduler | FIFO queue: preserved within the message group when `BufferSize` is 1, the default. Standard queue: no order to preserve | +| AWS SQS | `ChangeMessageVisibility` on the same message, no scheduler | FIFO queue: the message is not re-published, so its message ID, message group ID and deduplication ID do not change. Order within the group is preserved when `BufferSize` is 1, the default, and the group is blocked until the delay ends; other message groups keep flowing. Standard queue: no order to preserve | | RabbitMQ | A new message, through the delayed message exchange if the exchange has `SupportDelay` set, otherwise through the scheduler | De-orders | | Azure Service Bus, topic subscription | Abandons the message. The delay is ignored and a warning is logged | Not guaranteed | | Azure Service Bus, `UseServiceBusQueue` or `ForwardTo` | A new message scheduled on the broker, or through the scheduler with `RequeueSchedulerMode.Global` | De-orders | @@ -106,8 +106,6 @@ With a delay of zero, RabbitMQ and the transports in the last row skip the sched Unless the table says the order is preserved, you cannot rely on the order of messages in the channel after a `DeferMessageAction`. 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 when `BufferSize` is 1, the default, and the group is blocked until the delay ends; other message groups keep flowing. With a `BufferSize` above 1, messages of the group that were already fetched still run while the deferred one waits. 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. - A useful rule of thumb is: * **Queue**: You can use `DeferMessageAction` without other design decisions, as items on the queue are not ordered.