Skip to content

Commit ef65c8e

Browse files
committed
[Messenger][Sqs] Add SQS fair queues support
1 parent 1529342 commit ef65c8e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

messenger.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,6 +1839,23 @@ The transport has a number of options:
18391839
FIFO queues don't support setting a delay per message, a value of ``delay: 0``
18401840
is required in the retry strategy settings.
18411841

1842+
.. note::
1843+
1844+
AWS SQS supports fair queue processing in standard queues (not FIFO queues)
1845+
by using the ``MessageGroupId`` parameter. This allows messages to be
1846+
processed fairly across multiple message groups without requiring a FIFO
1847+
queue, which is useful for multi-tenant applications where you want to
1848+
prevent one tenant from monopolizing queue processing.
1849+
1850+
To enable fair queue processing, add the
1851+
:class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Transport\\AmazonSqsFairQueueStamp`
1852+
to your message envelope with a tenant or group identifier. If both
1853+
:class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Transport\\AmazonSqsFifoStamp`
1854+
and
1855+
:class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Transport\\AmazonSqsFairQueueStamp`
1856+
are present on the same message, the FIFO stamp takes precedence. The fair queue stamp
1857+
only works on standard queues and has no effect on FIFO queues.
1858+
18421859
The SQS transport supports the ``--keepalive`` option by using the ``ChangeMessageVisibility``
18431860
action to periodically update the ``VisibilityTimeout`` of the message.
18441861

0 commit comments

Comments
 (0)