Skip to content

Commit da13815

Browse files
committed
Updated docs with correct default values for SQS and new properties retain_failed_jobs and error_visibility_timeout
1 parent 840a9b8 commit da13815

File tree

1 file changed

+48
-8
lines changed

1 file changed

+48
-8
lines changed

queues/sqs.md

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ sqs:
3838
# Default: empty
3939
endpoint: ""
4040
```
41+
4142
{% endcode %}
4243
4344
### Examples
@@ -52,12 +53,14 @@ If you access your AWS SQS queue from inside AWS via a service that supports dyn
5253
queue is in the same region.
5354

5455
{% code title=".rr.yaml" %}
56+
5557
```yaml
5658
sqs:
57-
# No parameters are required. Normally, if your IAM role has the required permissions and your service endpoint
58-
# is in the same region, the environment variables associated with your instance/task will resolve all the
59-
# configuration for you. You must provide the parent sqs key to enable SQS, even if you want to use the defaults.
59+
# No parameters are required. Normally, if your IAM role has the required permissions and your service endpoint
60+
# is in the same region, the environment variables associated with your instance/task will resolve all the
61+
# configuration for you. You must provide the parent sqs key to enable SQS, even if you want to use the defaults.
6062
```
63+
6164
{% endcode %}
6265

6366
#### AWS SQS in different region with dynamic IAM
@@ -66,11 +69,13 @@ If you access your AWS SQS queue from inside AWS via a service that supports dyn
6669
queue is in a different region.
6770

6871
{% code title=".rr.yaml" %}
72+
6973
```yaml
7074
sqs:
7175
# Only region is required
7276
region: eu-central-1
7377
```
78+
7479
{% endcode %}
7580

7681
#### AWS SQS without dynamic IAM
@@ -80,6 +85,7 @@ an access key and secret. If you access the service from outside AWS, you must a
8085
You may also use this option if your service *does* support dynamic IAM, but you want to use explicit access keys.
8186

8287
{% code title=".rr.yaml" %}
88+
8389
```yaml
8490
sqs:
8591
key: ASIAIOSFODNN7EXAMPLE
@@ -88,17 +94,20 @@ sqs:
8894
# If in a different region *or* if outside AWS, provide the correct region.
8995
region: eu-west-1
9096
```
97+
9198
{% endcode %}
9299

93100
#### Self-hosted (ElasticMQ)
94101

95102
If you self-host your SQS-compatible queue, only the endpoint is required.
96103

97104
{% code title=".rr.yaml" %}
105+
98106
```yaml
99107
sqs:
100108
endpoint: http://127.0.0.1:9324
101109
```
110+
102111
{% endcode %}
103112

104113
After you have configured the driver, you should configure the queue that will use this connection.
@@ -171,18 +180,48 @@ Default: `10`
171180

172181
### Visibility Timeout
173182

174-
`visibility_timeout` - The duration (in seconds) that the received messages are hidden from subsequent retrieve requests
175-
after being retrieved by a `ReceiveMessage` request. Max value is `43200` seconds (12 hours).
183+
`visibility_timeout` - The duration (in seconds) that received messages are hidden from subsequent retrieve requests
184+
after being retrieved by a consumer. This value should be **longer** than the time you expect each job to take, or the
185+
job may run multiple times. You should rarely set this value to zero, as that will cause the same job to be delivered to
186+
**all** consumers of the queue each time they request messages from it. If you do not provide a value for this
187+
parameter, the `VisibilityTimeout` attribute of the queue is used, which defaults to 30 seconds. For more
188+
information, see the documentation on
189+
[visibility timeouts](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html).
190+
191+
Max value is `43200` seconds (12 hours).
192+
Default: `null`
193+
194+
### Error Visibility Timeout
195+
196+
`error_visibility_timeout` - If `retain_failed_jobs` is enabled, this is the duration (in seconds) that `NACK`'ed (or
197+
failed) jobs will have their visibility timeout changed to. Note that you cannot have a message remain invisible for
198+
more than the maximum value in cases where it fails multiple times, so setting this value to the maximum is error-prone.
199+
This parameter is ignored if `retain_failed_jobs` is `false`, and it must be larger than zero to apply.
176200

201+
Max value is `43200` seconds (12 hours).
177202
Default: `0`
178203

204+
### Retain Failed Jobs
205+
206+
`retain_failed_jobs` - If enabled, jobs will not be deleted and requeued if they fail. Instead, RoadRunner will
207+
simply let them be processed again after `visibility_timeout` has passed. If you set `error_visibility_timeout` and
208+
enable this feature, RoadRunner will change the timeout to the value of `error_visibility_timeout`. This lets you
209+
customize the timeout for errors specifically. If you enable this feature, you can configure SQS to automatically
210+
move jobs that fail multiple times to a
211+
[dead-letter queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html).
212+
213+
Default: `false`
214+
179215
### Wait Time
180216

181217
`wait_time_seconds` - The duration (in seconds) for which the call waits for a message to arrive in the queue before
182218
returning. If a message is available, the call returns sooner than `wait_time_seconds`. If no messages are available and
183-
the wait time expires, the call returns successfully with an empty list of messages.
219+
the wait time expires, the call returns successfully with an empty list of messages. If you do not provide a value for
220+
this parameter, the `ReceiveMessageWaitTimeSeconds` attribute of the queue is used, which defaults to 0, and you will be
221+
using short polling. See the documentation on the differences between
222+
[short and long polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html).
184223

185-
Default: `5`
224+
Default: `null`
186225

187226
### Queue
188227

@@ -195,7 +234,8 @@ Default: `default`
195234

196235
`message_group_id` - Message group ID is required for FIFO queues. Messages that belong to the same message group are
197236
processed in a FIFO manner.
198-
More info: [link](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html#SQS-SendMessage-request-MessageGroupId)
237+
More info:
238+
[link](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html#SQS-SendMessage-request-MessageGroupId)
199239

200240
### Skip Queue Declaration
201241

0 commit comments

Comments
 (0)