@@ -1168,17 +1168,54 @@ The ``SQS`` transport configuration looks like this:
1168
1168
.. code-block :: bash
1169
1169
1170
1170
# .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
1172
1173
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
+ ================== ===================================== ======================
1173
1200
1174
1201
.. note ::
1175
1202
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\C omponent\M essenger\B ridge\A mazonSqs\T ransport\A mazonSqsFifoStamp `
1215
+ to define the ``Message group ID `` and the ``Message deduplication ID ``.
1181
1216
1217
+ FIFO queues don't support setting a delay per message, a value of ``delay: 0 ``
1218
+ is required in the retry strategy settings.
1182
1219
1183
1220
Serializing Messages
1184
1221
~~~~~~~~~~~~~~~~~~~~
@@ -1753,3 +1790,6 @@ Learn more
1753
1790
.. _`streams` : https://redis.io/topics/streams-intro
1754
1791
.. _`Supervisor docs` : http://supervisord.org/
1755
1792
.. _`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