Skip to content

Commit 9d618a7

Browse files
committed
Added SQS Messenger docs
1 parent 136ae1e commit 9d618a7

File tree

1 file changed

+46
-6
lines changed

1 file changed

+46
-6
lines changed

messenger.rst

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,17 +1285,54 @@ The ``SQS`` transport configuration looks like this:
12851285
.. code-block:: bash
12861286
12871287
# .env
1288-
MESSENGER_TRANSPORT_DSN=sqs://guest:guest@sqs.eu-west-3.amazonaws.com/test?region=eu-west-3
1288+
MESSENGER_TRANSPORT_DSN=sqs://AKIAIOSFODNN7EXAMPLE:j17M97ffSVoKI0briFoo9a@sqs.eu-west-3.amazonaws.com/messages
1289+
#MESSENGER_TRANSPORT_DSN=sqs://localhost:9494/messages?sslmode=disable
12891290
1291+
.. note::
1292+
1293+
The transport will automatically create queues that are needed. This
1294+
can be disabled setting the "auto_setup" option to ``false``.
1295+
1296+
A number of options can be configured via the DSN or via the ``options`` key
1297+
under the transport in ``messenger.yaml``:
1298+
1299+
================== ===================================== ======================
1300+
Option Description Default
1301+
================== ===================================== ======================
1302+
endpoint Absolute URL to the SQS service https://sqs.eu-west-1.amazonaws.com
1303+
region Name of the AWS region eu-west-1
1304+
queue_name Name of the queue messages
1305+
account Identifier of the AWS account The owner of the credentials
1306+
access_key AWS access key
1307+
secret_key AWS secret key
1308+
buffer_size Number of messages to prefetch 9
1309+
wait_time `Long polling`_ duration in seconds 20
1310+
poll_timeout Wait for new message duration in 0.1
1311+
seconds
1312+
visibility_timeout Amount of seconds the message will Queue's configuration
1313+
not be visible (`Visibility Timeout`_)
1314+
auto_setup Whether the table should be created true
1315+
automatically during send / get.
1316+
================== ===================================== ======================
12901317

12911318
.. note::
12921319

1293-
By default, the transport will automatically create queue that are needed. That can be disabled.
1294-
1295-
The transport has a number of other options, including ways to configure
1296-
the exchange, queues binding keys and more. See the documentation on
1297-
:class:`Symfony\\Component\\Messenger\\Transport\\AmazonSqs\\Connection`.
1320+
The ``wait_time`` parameter define the maximum duration Amazon SQS should
1321+
wait until a message is available in a queue before sending a response.
1322+
It helps reducing the cost of using Amazon SQS by eliminating the number
1323+
of empty responses.
1324+
1325+
The ``poll_timeout`` parameter define the duration the receiver should wait
1326+
before returning null. It avoids blocking other receivers from being called.
1327+
1328+
.. note::
1329+
1330+
If the queue name is suffixed by ``.fifo``, AWS will creates a `FIFO queue`_
1331+
Use the stamp :class:`Symfony\Component\Messenger\Bridge\AmazonSqs\Transport\AmazonSqsFifoStamp`
1332+
to define the ``Message group ID`` and the ``Message deduplication ID``.
12981333

1334+
FIFO queues don't support setting a delay per message, a value of ``delay: 0``
1335+
is required in the retry strategy settings.
12991336

13001337
Serializing Messages
13011338
~~~~~~~~~~~~~~~~~~~~
@@ -1870,3 +1907,6 @@ Learn more
18701907
.. _`streams`: https://redis.io/topics/streams-intro
18711908
.. _`Supervisor docs`: http://supervisord.org/
18721909
.. _`SymfonyCasts' message serializer tutorial`: https://symfonycasts.com/screencast/messenger/transport-serializer
1910+
.. _`Long polling`: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html
1911+
.. _`Visibility Timeout`: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
1912+
.. _`FIFO queue': https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html

0 commit comments

Comments
 (0)