Skip to content

Commit 08344a4

Browse files
[Messenger] Add AddFifoStamp middleware for SQS
1 parent 80f7c9e commit 08344a4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

messenger.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,6 +1811,27 @@ The transport has a number of options:
18111811
Use the stamp :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Transport\\AmazonSqsFifoStamp`
18121812
to define the ``Message group ID`` and the ``Message deduplication ID``.
18131813

1814+
Another possibility is to enable the
1815+
:class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Middleware\\AddFifoStampMiddleware`.
1816+
If your message implements
1817+
:class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\MessageDeduplicationAwareInterface`,
1818+
the middleware will automatically add the
1819+
:class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Transport\\AmazonSqsFifoStamp`
1820+
and set the ``Message deduplication ID``. Additionally, if your message implements the
1821+
:class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\MessageGroupAwareInterface`,
1822+
the middleware will automatically set the ``Message group ID`` of the stamp.
1823+
1824+
You can learn more about middlewares in
1825+
:ref:`the dedicated section <messenger_middleware>`.
1826+
1827+
.. versionadded:: 6.4
1828+
1829+
The
1830+
:class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Middleware\\AddFifoStampMiddleware`,
1831+
:class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\MessageDeduplicationAwareInterface`
1832+
and :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\MessageGroupAwareInterface`
1833+
were introduced in Symfony 6.4.
1834+
18141835
FIFO queues don't support setting a delay per message, a value of ``delay: 0``
18151836
is required in the retry strategy settings.
18161837

@@ -2379,6 +2400,8 @@ are a variety of different stamps for different purposes and they're used intern
23792400
to track information about a message - like the message bus that's handling it
23802401
or if it's being retried after failure.
23812402

2403+
.. _messenger_middleware:
2404+
23822405
Middleware
23832406
~~~~~~~~~~
23842407

0 commit comments

Comments
 (0)