@@ -1285,17 +1285,54 @@ The ``SQS`` transport configuration looks like this:
1285
1285
.. code-block :: bash
1286
1286
1287
1287
# .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
1289
1290
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
+ ================== ===================================== ======================
1290
1317
1291
1318
.. note ::
1292
1319
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\C omponent\M essenger\B ridge\A mazonSqs\T ransport\A mazonSqsFifoStamp `
1332
+ to define the ``Message group ID `` and the ``Message deduplication ID ``.
1298
1333
1334
+ FIFO queues don't support setting a delay per message, a value of ``delay: 0 ``
1335
+ is required in the retry strategy settings.
1299
1336
1300
1337
Serializing Messages
1301
1338
~~~~~~~~~~~~~~~~~~~~
@@ -1870,3 +1907,6 @@ Learn more
1870
1907
.. _`streams` : https://redis.io/topics/streams-intro
1871
1908
.. _`Supervisor docs` : http://supervisord.org/
1872
1909
.. _`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