diff --git a/messenger.rst b/messenger.rst index 75e613121b9..bd3e265fdd1 100644 --- a/messenger.rst +++ b/messenger.rst @@ -1811,6 +1811,27 @@ The transport has a number of options: Use the stamp :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Transport\\AmazonSqsFifoStamp` to define the ``Message group ID`` and the ``Message deduplication ID``. + Another possibility is to enable the + :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Middleware\\AddFifoStampMiddleware`. + If your message implements + :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\MessageDeduplicationAwareInterface`, + the middleware will automatically add the + :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Transport\\AmazonSqsFifoStamp` + and set the ``Message deduplication ID``. Additionally, if your message implements the + :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\MessageGroupAwareInterface`, + the middleware will automatically set the ``Message group ID`` of the stamp. + + You can learn more about middlewares in + :ref:`the dedicated section `. + + .. versionadded:: 6.4 + + The + :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\Middleware\\AddFifoStampMiddleware`, + :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\MessageDeduplicationAwareInterface` + and :class:`Symfony\\Component\\Messenger\\Bridge\\AmazonSqs\\MessageGroupAwareInterface` + were introduced in Symfony 6.4. + FIFO queues don't support setting a delay per message, a value of ``delay: 0`` is required in the retry strategy settings. @@ -2379,6 +2400,8 @@ are a variety of different stamps for different purposes and they're used intern to track information about a message - like the message bus that's handling it or if it's being retried after failure. +.. _messenger_middleware: + Middleware ~~~~~~~~~~