8000 Added SQS Messenger docs · symfony/symfony-docs@47dbe33 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47dbe33

Browse files
Nyholmwouterj
authored andcommitted
Added SQS Messenger docs
1 parent 9dd75a9 commit 47dbe33

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
@@ -1168,17 +1168,54 @@ The ``SQS`` transport configuration looks like this:
11681168
.. code-block:: bash
11691169
11701170
# .env
1171-
MESSENGER_TRANSPORT_DSN=sqs://guest:guest@sqs.eu-west-3.amazonaws.com/test?region=eu-west-3
1171+
MESSENGER_TRANSPORT_DSN=sqs://AKIAIOSFODNN7EXAMPLE:j17M97ffSVoKI0briFoo9a@sqs.eu-west-3.amazonaws.com/messages
1172+
#MESSENGER_TRANSPORT_DSN=sqs://localhost:9494/messages?sslmode=disable
11721173
1174+
.. note::
1175+
1176+
The transport will automatically create queues that are needed. This
1177+
can be disabled setting the "auto_setup" option to ``false``.
1178+
1179+
A number of options can be configured via the DSN or via the ``options`` key
1180+
under the transport in ``messenger.yaml``:
1181+
1182+
================== ===================================== ======================
1183+
Option Description Default
1184+
================== ===================================== ======================
1185+
endpoint Absolute URL to the SQS service https://sqs.eu-west-1.amazonaws.com
1186+
region Name of the AWS region eu-west-1
1187+
queue_name Name of the queue messages
1188+
account Identifier of the AWS account The owner of the credentials
1189+
access_key AWS access key
1190+
secret_key AWS secret key
1191+
buffer_size Number of messages to prefetch 9
1192+
wait_time `Long polling`_ duration in seconds 20
1193+
poll_timeout Wait for new message duration in 0.1
1194+
seconds
1195+
visibility_timeout Amount of seconds the message will Queue's configuration
1196+
not be visible (`Visibility Timeout`_)
1197+
auto_setup Whether the table should be created true
1198+
automatically during send / get.
1199+
================== ===================================== ======================
11731200

11741201
.. note::
11751202

1176-
By default, the transport will automatically create queue that are needed. That can be disabled.
1177-
1178-
The transport has a number of other options, including ways to configure
1179-
the exchange, queues binding keys and more. See the documentation on
1180-
:class:`Symfony\\Component\\Messenger\\Transport\\AmazonSqs\\Connection`.
1203+
The ``wait_time`` parameter define the maximum duration Amazon SQS should
1204+
wait until a message is available in a queue before sending a response.
1205+
It helps reducing the cost of using Amazon SQS by eliminating the number
1206+
of empty responses.
1207+
1208+
The ``poll_timeout`` parameter define the duration the receiver should wait
1209+
before returning null. It avoids blocking other receivers from being called.
1210+
1211+
.. note::
1212+
1213+
If the queue name is suffixed by ``.fifo``, AWS will creates a `FIFO queue`_
1214+
Use the stamp :class:`Symfony\Component\Messenger\Bridge\AmazonSqs\Transport\AmazonSqsFifoStamp`
1215+
to define the ``Message group ID`` and the ``Message deduplication ID``.
11811216

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

11831220
Serializing Messages
11841221
~~~~~~~~~~~~~~~~~~~~
@@ -1753,3 +1790,6 @@ Learn more
17531790
.. _`streams`: https://redis.io/topics/streams-intro
17541791
.. _`Supervisor docs`: http://supervisord.org/
17551792
.. _`SymfonyCasts' message serializer tutorial`: https://symfonycasts.com/screencast/messenger/transport-serializer
1793+
.. _`Long polling`: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html
1794+
.. _`Visibility Timeout`: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
1795+
.. _`FIFO queue': https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html

0 commit comments

Comments
 (0)
0