Skip to content

[Messenger][AmazonSQS] Add AddFifoStamp middleware #19055

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions messenger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <messenger_middleware>`.

.. 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.

Expand Down Expand Up @@ -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
~~~~~~~~~~

Expand Down