From ef65c8e6df3e9ade11da89dce25ff7b585583735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ku=C5=BAnik?= Date: Tue, 11 Nov 2025 21:26:07 +0100 Subject: [PATCH] [Messenger][Sqs] Add SQS fair queues support --- messenger.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/messenger.rst b/messenger.rst index a535b077c2d..1ea749d7cd2 100644 --- a/messenger.rst +++ b/messenger.rst @@ -1839,6 +1839,23 @@ The transport has a number of options: FIFO queues don't support setting a delay per message, a value of ``delay: 0`` is required in the retry strategy settings. +.. note:: + + AWS SQS supports fair queue processing in standard queues (not FIFO queues) + by using the ``MessageGroupId`` parameter. This allows messages to be + processed fairly across multiple message groups without requiring a FIFO + queue, which is useful for multi-tenant applications where you want to + prevent one tenant from monopolizing queue processing. + + To enable fair queue processing, add the + :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Transport\\AmazonSqsFairQueueStamp` + to your message envelope with a tenant or group identifier. If both + :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Transport\\AmazonSqsFifoStamp` + and + :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Transport\\AmazonSqsFairQueueStamp` + are present on the same message, the FIFO stamp takes precedence. The fair queue stamp + only works on standard queues and has no effect on FIFO queues. + The SQS transport supports the ``--keepalive`` option by using the ``ChangeMessageVisibility`` action to periodically update the ``VisibilityTimeout`` of the message.