aws-sdk-sqs 1.9.0 → 1.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +455 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -0
- data/lib/aws-sdk-sqs/client.rb +1148 -438
- data/lib/aws-sdk-sqs/client_api.rb +383 -45
- data/lib/aws-sdk-sqs/customizations.rb +2 -0
- data/lib/aws-sdk-sqs/endpoint_parameters.rb +66 -0
- data/lib/aws-sdk-sqs/endpoint_provider.rb +57 -0
- data/lib/aws-sdk-sqs/endpoints.rb +338 -0
- data/lib/aws-sdk-sqs/errors.rb +463 -1
- data/lib/aws-sdk-sqs/message.rb +20 -9
- data/lib/aws-sdk-sqs/plugins/endpoints.rb +116 -0
- data/lib/aws-sdk-sqs/plugins/md5s.rb +9 -7
- data/lib/aws-sdk-sqs/plugins/queue_urls.rb +26 -12
- data/lib/aws-sdk-sqs/queue.rb +269 -125
- data/lib/aws-sdk-sqs/queue_poller.rb +75 -37
- data/lib/aws-sdk-sqs/resource.rb +208 -79
- data/lib/aws-sdk-sqs/types.rb +1294 -539
- data/lib/aws-sdk-sqs.rb +16 -6
- data/sig/client.rbs +363 -0
- data/sig/errors.rbs +98 -0
- data/sig/message.rbs +73 -0
- data/sig/queue.rbs +163 -0
- data/sig/resource.rbs +105 -0
- data/sig/types.rbs +471 -0
- data/sig/waiters.rbs +13 -0
- metadata +29 -16
data/lib/aws-sdk-sqs/queue.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
4
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
5
7
|
#
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
8
10
|
module Aws::SQS
|
11
|
+
|
9
12
|
class Queue
|
10
13
|
|
11
14
|
extend Aws::Deprecations
|
@@ -21,6 +24,7 @@ module Aws::SQS
|
|
21
24
|
@url = extract_url(args, options)
|
22
25
|
@data = options.delete(:data)
|
23
26
|
@client = options.delete(:client) || Client.new(options)
|
27
|
+
@waiter_block_warned = false
|
24
28
|
end
|
25
29
|
|
26
30
|
# @!group Read-Only Attributes
|
@@ -50,10 +54,12 @@ module Aws::SQS
|
|
50
54
|
#
|
51
55
|
# @return [self]
|
52
56
|
def load
|
53
|
-
resp =
|
57
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
58
|
+
@client.get_queue_attributes(
|
54
59
|
queue_url: @url,
|
55
60
|
attribute_names: ["All"]
|
56
61
|
)
|
62
|
+
end
|
57
63
|
@data = resp.data
|
58
64
|
self
|
59
65
|
end
|
@@ -90,23 +96,22 @@ module Aws::SQS
|
|
90
96
|
# characters include alphanumeric characters, hyphens (`-`), and
|
91
97
|
# underscores (`_`).
|
92
98
|
# @option options [required, Array<String>] :aws_account_ids
|
93
|
-
# The
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
# Queue Service Developer Guide*.
|
99
|
+
# The Amazon Web Services account numbers of the [principals][1] who are
|
100
|
+
# to receive permission. For information about locating the Amazon Web
|
101
|
+
# Services account identification, see [Your Amazon Web Services
|
102
|
+
# Identifiers][2] in the *Amazon SQS Developer Guide*.
|
98
103
|
#
|
99
104
|
#
|
100
105
|
#
|
101
|
-
# [1]:
|
102
|
-
# [2]:
|
106
|
+
# [1]: https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P
|
107
|
+
# [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication
|
103
108
|
# @option options [required, Array<String>] :actions
|
104
109
|
# The action the client wants to allow for the specified principal.
|
105
110
|
# Valid values: the name of any action or `*`.
|
106
111
|
#
|
107
112
|
# For more information about these actions, see [Overview of Managing
|
108
113
|
# Access Permissions to Your Amazon Simple Queue Service Resource][1] in
|
109
|
-
# the *Amazon
|
114
|
+
# the *Amazon SQS Developer Guide*.
|
110
115
|
#
|
111
116
|
# Specifying `SendMessage`, `DeleteMessage`, or
|
112
117
|
# `ChangeMessageVisibility` for `ActionName.n` also grants permissions
|
@@ -116,11 +121,13 @@ module Aws::SQS
|
|
116
121
|
#
|
117
122
|
#
|
118
123
|
#
|
119
|
-
# [1]:
|
124
|
+
# [1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html
|
120
125
|
# @return [EmptyStructure]
|
121
126
|
def add_permission(options = {})
|
122
127
|
options = options.merge(queue_url: @url)
|
123
|
-
resp =
|
128
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
129
|
+
@client.add_permission(options)
|
130
|
+
end
|
124
131
|
resp.data
|
125
132
|
end
|
126
133
|
|
@@ -137,12 +144,14 @@ module Aws::SQS
|
|
137
144
|
# })
|
138
145
|
# @param [Hash] options ({})
|
139
146
|
# @option options [required, Array<Types::ChangeMessageVisibilityBatchRequestEntry>] :entries
|
140
|
-
#
|
147
|
+
# Lists the receipt handles of the messages for which the visibility
|
141
148
|
# timeout must be changed.
|
142
149
|
# @return [Types::ChangeMessageVisibilityBatchResult]
|
143
150
|
def change_message_visibility_batch(options = {})
|
144
151
|
options = options.merge(queue_url: @url)
|
145
|
-
resp =
|
152
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
153
|
+
@client.change_message_visibility_batch(options)
|
154
|
+
end
|
146
155
|
resp.data
|
147
156
|
end
|
148
157
|
|
@@ -153,7 +162,9 @@ module Aws::SQS
|
|
153
162
|
# @return [EmptyStructure]
|
154
163
|
def delete(options = {})
|
155
164
|
options = options.merge(queue_url: @url)
|
156
|
-
resp =
|
165
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
166
|
+
@client.delete_queue(options)
|
167
|
+
end
|
157
168
|
resp.data
|
158
169
|
end
|
159
170
|
|
@@ -169,11 +180,13 @@ module Aws::SQS
|
|
169
180
|
# })
|
170
181
|
# @param [Hash] options ({})
|
171
182
|
# @option options [required, Array<Types::DeleteMessageBatchRequestEntry>] :entries
|
172
|
-
#
|
183
|
+
# Lists the receipt handles for the messages to be deleted.
|
173
184
|
# @return [Types::DeleteMessageBatchResult]
|
174
185
|
def delete_messages(options = {})
|
175
186
|
options = options.merge(queue_url: @url)
|
176
|
-
resp =
|
187
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
188
|
+
@client.delete_message_batch(options)
|
189
|
+
end
|
177
190
|
resp.data
|
178
191
|
end
|
179
192
|
|
@@ -184,14 +197,16 @@ module Aws::SQS
|
|
184
197
|
# @return [EmptyStructure]
|
185
198
|
def purge(options = {})
|
186
199
|
options = options.merge(queue_url: @url)
|
187
|
-
resp =
|
200
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
201
|
+
@client.purge_queue(options)
|
202
|
+
end
|
188
203
|
resp.data
|
189
204
|
end
|
190
205
|
|
191
206
|
# @example Request syntax with placeholder values
|
192
207
|
#
|
193
208
|
# message = queue.receive_messages({
|
194
|
-
# attribute_names: ["All"], # accepts All, Policy, VisibilityTimeout, MaximumMessageSize, MessageRetentionPeriod, ApproximateNumberOfMessages, ApproximateNumberOfMessagesNotVisible, CreatedTimestamp, LastModifiedTimestamp, QueueArn, ApproximateNumberOfMessagesDelayed, DelaySeconds, ReceiveMessageWaitTimeSeconds, RedrivePolicy, FifoQueue, ContentBasedDeduplication, KmsMasterKeyId, KmsDataKeyReusePeriodSeconds
|
209
|
+
# attribute_names: ["All"], # accepts All, Policy, VisibilityTimeout, MaximumMessageSize, MessageRetentionPeriod, ApproximateNumberOfMessages, ApproximateNumberOfMessagesNotVisible, CreatedTimestamp, LastModifiedTimestamp, QueueArn, ApproximateNumberOfMessagesDelayed, DelaySeconds, ReceiveMessageWaitTimeSeconds, RedrivePolicy, FifoQueue, ContentBasedDeduplication, KmsMasterKeyId, KmsDataKeyReusePeriodSeconds, DeduplicationScope, FifoThroughputLimit, RedriveAllowPolicy, SqsManagedSseEnabled
|
195
210
|
# message_attribute_names: ["MessageAttributeName"],
|
196
211
|
# max_number_of_messages: 1,
|
197
212
|
# visibility_timeout: 1,
|
@@ -200,40 +215,48 @@ module Aws::SQS
|
|
200
215
|
# })
|
201
216
|
# @param [Hash] options ({})
|
202
217
|
# @option options [Array<String>] :attribute_names
|
203
|
-
# A list of
|
204
|
-
# attributes include:
|
218
|
+
# A list of attributes that need to be returned along with each message.
|
219
|
+
# These attributes include:
|
205
220
|
#
|
206
|
-
# * `All`
|
221
|
+
# * `All` – Returns all values.
|
207
222
|
#
|
208
|
-
# * `ApproximateFirstReceiveTimestamp`
|
223
|
+
# * `ApproximateFirstReceiveTimestamp` – Returns the time the message
|
209
224
|
# was first received from the queue ([epoch time][1] in milliseconds).
|
210
225
|
#
|
211
|
-
# * `ApproximateReceiveCount`
|
212
|
-
# has been received
|
226
|
+
# * `ApproximateReceiveCount` – Returns the number of times a message
|
227
|
+
# has been received across all queues but not deleted.
|
228
|
+
#
|
229
|
+
# * `AWSTraceHeader` – Returns the X-Ray trace header string.
|
213
230
|
#
|
214
231
|
# * `SenderId`
|
215
232
|
#
|
216
|
-
# * For
|
233
|
+
# * For a user, returns the user ID, for example
|
217
234
|
# `ABCDEFGHI1JKLMNOPQ23R`.
|
218
235
|
#
|
219
236
|
# * For an IAM role, returns the IAM role ID, for example
|
220
237
|
# `ABCDE1F2GH3I4JK5LMNOP:i-a123b456`.
|
221
238
|
#
|
222
|
-
# * `SentTimestamp`
|
239
|
+
# * `SentTimestamp` – Returns the time the message was sent to the queue
|
223
240
|
# ([epoch time][1] in milliseconds).
|
224
241
|
#
|
225
|
-
# * `
|
242
|
+
# * `SqsManagedSseEnabled` – Enables server-side queue encryption using
|
243
|
+
# SQS owned encryption keys. Only one server-side encryption option is
|
244
|
+
# supported per queue (for example, [SSE-KMS][2] or [SSE-SQS][3]).
|
245
|
+
#
|
246
|
+
# * `MessageDeduplicationId` – Returns the value provided by the
|
226
247
|
# producer that calls the ` SendMessage ` action.
|
227
248
|
#
|
228
|
-
# * `MessageGroupId`
|
249
|
+
# * `MessageGroupId` – Returns the value provided by the producer that
|
229
250
|
# calls the ` SendMessage ` action. Messages with the same
|
230
251
|
# `MessageGroupId` are returned in sequence.
|
231
252
|
#
|
232
|
-
# * `SequenceNumber`
|
253
|
+
# * `SequenceNumber` – Returns the value provided by Amazon SQS.
|
233
254
|
#
|
234
255
|
#
|
235
256
|
#
|
236
257
|
# [1]: http://en.wikipedia.org/wiki/Unix_time
|
258
|
+
# [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html
|
259
|
+
# [3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html
|
237
260
|
# @option options [Array<String>] :message_attribute_names
|
238
261
|
# The name of the message attribute, where *N* is the index.
|
239
262
|
#
|
@@ -269,14 +292,25 @@ module Aws::SQS
|
|
269
292
|
# call returns sooner than `WaitTimeSeconds`. If no messages are
|
270
293
|
# available and the wait time expires, the call returns successfully
|
271
294
|
# with an empty list of messages.
|
295
|
+
#
|
296
|
+
# To avoid HTTP errors, ensure that the HTTP response timeout for
|
297
|
+
# `ReceiveMessage` requests is longer than the `WaitTimeSeconds`
|
298
|
+
# parameter. For example, with the Java SDK, you can set HTTP transport
|
299
|
+
# settings using the [ NettyNioAsyncHttpClient][1] for asynchronous
|
300
|
+
# clients, or the [ ApacheHttpClient][2] for synchronous clients.
|
301
|
+
#
|
302
|
+
#
|
303
|
+
#
|
304
|
+
# [1]: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.html
|
305
|
+
# [2]: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/apache/ApacheHttpClient.html
|
272
306
|
# @option options [String] :receive_request_attempt_id
|
273
307
|
# This parameter applies only to FIFO (first-in-first-out) queues.
|
274
308
|
#
|
275
309
|
# The token used for deduplication of `ReceiveMessage` calls. If a
|
276
310
|
# networking issue occurs after a `ReceiveMessage` action, and instead
|
277
|
-
# of a response you receive a generic error,
|
278
|
-
# action with an identical `ReceiveRequestAttemptId` to retrieve
|
279
|
-
# same set of messages, even if their visibility timeout has not yet
|
311
|
+
# of a response you receive a generic error, it is possible to retry the
|
312
|
+
# same action with an identical `ReceiveRequestAttemptId` to retrieve
|
313
|
+
# the same set of messages, even if their visibility timeout has not yet
|
280
314
|
# expired.
|
281
315
|
#
|
282
316
|
# * You can use `ReceiveRequestAttemptId` only for 5 minutes after a
|
@@ -289,7 +323,7 @@ module Aws::SQS
|
|
289
323
|
# `ReceiveRequestAttemptId`, Amazon SQS generates a
|
290
324
|
# `ReceiveRequestAttemptId`.
|
291
325
|
#
|
292
|
-
# *
|
326
|
+
# * It is possible to retry the `ReceiveMessage` action with the same
|
293
327
|
# `ReceiveRequestAttemptId` if none of the messages have been modified
|
294
328
|
# (deleted or had their visibility changes).
|
295
329
|
#
|
@@ -297,7 +331,7 @@ module Aws::SQS
|
|
297
331
|
# `ReceiveRequestAttemptId` return the same messages and receipt
|
298
332
|
# handles. If a retry occurs within the deduplication interval, it
|
299
333
|
# resets the visibility timeout. For more information, see [Visibility
|
300
|
-
# Timeout][1] in the *Amazon
|
334
|
+
# Timeout][1] in the *Amazon SQS Developer Guide*.
|
301
335
|
#
|
302
336
|
# If a caller of the `ReceiveMessage` action still processes messages
|
303
337
|
# when the visibility timeout expires and messages become visible,
|
@@ -320,24 +354,26 @@ module Aws::SQS
|
|
320
354
|
# visibility timeout expires. As a result, delays might occur but the
|
321
355
|
# messages in the queue remain in a strict order.
|
322
356
|
#
|
323
|
-
# The length of `ReceiveRequestAttemptId` is 128 characters.
|
357
|
+
# The maximum length of `ReceiveRequestAttemptId` is 128 characters.
|
324
358
|
# `ReceiveRequestAttemptId` can contain alphanumeric characters (`a-z`,
|
325
359
|
# `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~
|
326
360
|
# ``).
|
327
361
|
#
|
328
362
|
# For best practices of using `ReceiveRequestAttemptId`, see [Using the
|
329
|
-
# ReceiveRequestAttemptId Request Parameter][2] in the *Amazon
|
330
|
-
#
|
363
|
+
# ReceiveRequestAttemptId Request Parameter][2] in the *Amazon SQS
|
364
|
+
# Developer Guide*.
|
331
365
|
#
|
332
366
|
#
|
333
367
|
#
|
334
|
-
# [1]:
|
335
|
-
# [2]:
|
368
|
+
# [1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
|
369
|
+
# [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html
|
336
370
|
# @return [Message::Collection]
|
337
371
|
def receive_messages(options = {})
|
338
372
|
batch = []
|
339
373
|
options = options.merge(queue_url: @url)
|
340
|
-
resp =
|
374
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
375
|
+
@client.receive_message(options)
|
376
|
+
end
|
341
377
|
resp.data.messages.each do |m|
|
342
378
|
batch << Message.new(
|
343
379
|
queue_url: @url,
|
@@ -361,7 +397,9 @@ module Aws::SQS
|
|
361
397
|
# @return [EmptyStructure]
|
362
398
|
def remove_permission(options = {})
|
363
399
|
options = options.merge(queue_url: @url)
|
364
|
-
resp =
|
400
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
401
|
+
@client.remove_permission(options)
|
402
|
+
end
|
365
403
|
resp.data
|
366
404
|
end
|
367
405
|
|
@@ -379,12 +417,22 @@ module Aws::SQS
|
|
379
417
|
# data_type: "String", # required
|
380
418
|
# },
|
381
419
|
# },
|
420
|
+
# message_system_attributes: {
|
421
|
+
# "AWSTraceHeader" => {
|
422
|
+
# string_value: "String",
|
423
|
+
# binary_value: "data",
|
424
|
+
# string_list_values: ["String"],
|
425
|
+
# binary_list_values: ["data"],
|
426
|
+
# data_type: "String", # required
|
427
|
+
# },
|
428
|
+
# },
|
382
429
|
# message_deduplication_id: "String",
|
383
430
|
# message_group_id: "String",
|
384
431
|
# })
|
385
432
|
# @param [Hash] options ({})
|
386
433
|
# @option options [required, String] :message_body
|
387
|
-
# The message to send. The
|
434
|
+
# The message to send. The minimum size is one character. The maximum
|
435
|
+
# size is 256 KiB.
|
388
436
|
#
|
389
437
|
# A message can include only XML, JSON, and unformatted text. The
|
390
438
|
# following Unicode characters are allowed:
|
@@ -411,12 +459,22 @@ module Aws::SQS
|
|
411
459
|
# </note>
|
412
460
|
# @option options [Hash<String,Types::MessageAttributeValue>] :message_attributes
|
413
461
|
# Each message attribute consists of a `Name`, `Type`, and `Value`. For
|
414
|
-
# more information, see [Amazon SQS
|
415
|
-
# *Amazon
|
462
|
+
# more information, see [Amazon SQS message attributes][1] in the
|
463
|
+
# *Amazon SQS Developer Guide*.
|
464
|
+
#
|
465
|
+
#
|
416
466
|
#
|
467
|
+
# [1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes
|
468
|
+
# @option options [Hash<String,Types::MessageSystemAttributeValue>] :message_system_attributes
|
469
|
+
# The message system attribute to send. Each message system attribute
|
470
|
+
# consists of a `Name`, `Type`, and `Value`.
|
417
471
|
#
|
472
|
+
# * Currently, the only supported message system attribute is
|
473
|
+
# `AWSTraceHeader`. Its type must be `String` and its value must be a
|
474
|
+
# correctly formatted X-Ray trace header string.
|
418
475
|
#
|
419
|
-
#
|
476
|
+
# * The size of a message system attribute doesn't count towards the
|
477
|
+
# total size of a message.
|
420
478
|
# @option options [String] :message_deduplication_id
|
421
479
|
# This parameter applies only to FIFO (first-in-first-out) queues.
|
422
480
|
#
|
@@ -424,8 +482,8 @@ module Aws::SQS
|
|
424
482
|
# particular `MessageDeduplicationId` is sent successfully, any messages
|
425
483
|
# sent with the same `MessageDeduplicationId` are accepted successfully
|
426
484
|
# but aren't delivered during the 5-minute deduplication interval. For
|
427
|
-
# more information, see [ Exactly-
|
428
|
-
#
|
485
|
+
# more information, see [ Exactly-once processing][1] in the *Amazon SQS
|
486
|
+
# Developer Guide*.
|
429
487
|
#
|
430
488
|
# * Every message must have a unique `MessageDeduplicationId`,
|
431
489
|
#
|
@@ -465,19 +523,19 @@ module Aws::SQS
|
|
465
523
|
#
|
466
524
|
# </note>
|
467
525
|
#
|
468
|
-
# The length of `MessageDeduplicationId` is 128 characters.
|
526
|
+
# The maximum length of `MessageDeduplicationId` is 128 characters.
|
469
527
|
# `MessageDeduplicationId` can contain alphanumeric characters (`a-z`,
|
470
528
|
# `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~
|
471
529
|
# ``).
|
472
530
|
#
|
473
531
|
# For best practices of using `MessageDeduplicationId`, see [Using the
|
474
|
-
# MessageDeduplicationId Property][2] in the *Amazon
|
475
|
-
#
|
532
|
+
# MessageDeduplicationId Property][2] in the *Amazon SQS Developer
|
533
|
+
# Guide*.
|
476
534
|
#
|
477
535
|
#
|
478
536
|
#
|
479
|
-
# [1]:
|
480
|
-
# [2]:
|
537
|
+
# [1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html
|
538
|
+
# [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html
|
481
539
|
# @option options [String] :message_group_id
|
482
540
|
# This parameter applies only to FIFO (first-in-first-out) queues.
|
483
541
|
#
|
@@ -502,19 +560,20 @@ module Aws::SQS
|
|
502
560
|
# (!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
|
503
561
|
#
|
504
562
|
# For best practices of using `MessageGroupId`, see [Using the
|
505
|
-
# MessageGroupId Property][1] in the *Amazon
|
506
|
-
# Developer Guide*.
|
563
|
+
# MessageGroupId Property][1] in the *Amazon SQS Developer Guide*.
|
507
564
|
#
|
508
565
|
# `MessageGroupId` is required for FIFO queues. You can't use it for
|
509
566
|
# Standard queues.
|
510
567
|
#
|
511
568
|
#
|
512
569
|
#
|
513
|
-
# [1]:
|
570
|
+
# [1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html
|
514
571
|
# @return [Types::SendMessageResult]
|
515
572
|
def send_message(options = {})
|
516
573
|
options = options.merge(queue_url: @url)
|
517
|
-
resp =
|
574
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
575
|
+
@client.send_message(options)
|
576
|
+
end
|
518
577
|
resp.data
|
519
578
|
end
|
520
579
|
|
@@ -535,6 +594,15 @@ module Aws::SQS
|
|
535
594
|
# data_type: "String", # required
|
536
595
|
# },
|
537
596
|
# },
|
597
|
+
# message_system_attributes: {
|
598
|
+
# "AWSTraceHeader" => {
|
599
|
+
# string_value: "String",
|
600
|
+
# binary_value: "data",
|
601
|
+
# string_list_values: ["String"],
|
602
|
+
# binary_list_values: ["data"],
|
603
|
+
# data_type: "String", # required
|
604
|
+
# },
|
605
|
+
# },
|
538
606
|
# message_deduplication_id: "String",
|
539
607
|
# message_group_id: "String",
|
540
608
|
# },
|
@@ -546,7 +614,9 @@ module Aws::SQS
|
|
546
614
|
# @return [Types::SendMessageBatchResult]
|
547
615
|
def send_messages(options = {})
|
548
616
|
options = options.merge(queue_url: @url)
|
549
|
-
resp =
|
617
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
618
|
+
@client.send_message_batch(options)
|
619
|
+
end
|
550
620
|
resp.data
|
551
621
|
end
|
552
622
|
|
@@ -564,81 +634,119 @@ module Aws::SQS
|
|
564
634
|
# The following lists the names, descriptions, and values of the special
|
565
635
|
# request parameters that the `SetQueueAttributes` action uses:
|
566
636
|
#
|
567
|
-
# * `DelaySeconds`
|
637
|
+
# * `DelaySeconds` – The length of time, in seconds, for which the
|
568
638
|
# delivery of all messages in the queue is delayed. Valid values: An
|
569
639
|
# integer from 0 to 900 (15 minutes). Default: 0.
|
570
640
|
#
|
571
|
-
# * `MaximumMessageSize`
|
641
|
+
# * `MaximumMessageSize` – The limit of how many bytes a message can
|
572
642
|
# contain before Amazon SQS rejects it. Valid values: An integer from
|
573
643
|
# 1,024 bytes (1 KiB) up to 262,144 bytes (256 KiB). Default: 262,144
|
574
644
|
# (256 KiB).
|
575
645
|
#
|
576
|
-
# * `MessageRetentionPeriod`
|
646
|
+
# * `MessageRetentionPeriod` – The length of time, in seconds, for which
|
577
647
|
# Amazon SQS retains a message. Valid values: An integer representing
|
578
648
|
# seconds, from 60 (1 minute) to 1,209,600 (14 days). Default: 345,600
|
579
|
-
# (4 days).
|
649
|
+
# (4 days). When you change a queue's attributes, the change can take
|
650
|
+
# up to 60 seconds for most of the attributes to propagate throughout
|
651
|
+
# the Amazon SQS system. Changes made to the `MessageRetentionPeriod`
|
652
|
+
# attribute can take up to 15 minutes and will impact existing
|
653
|
+
# messages in the queue potentially causing them to be expired and
|
654
|
+
# deleted if the `MessageRetentionPeriod` is reduced below the age of
|
655
|
+
# existing messages.
|
656
|
+
#
|
657
|
+
# * `Policy` – The queue's policy. A valid Amazon Web Services policy.
|
658
|
+
# For more information about policy structure, see [Overview of Amazon
|
659
|
+
# Web Services IAM Policies][1] in the *Identity and Access Management
|
660
|
+
# User Guide*.
|
661
|
+
#
|
662
|
+
# * `ReceiveMessageWaitTimeSeconds` – The length of time, in seconds,
|
663
|
+
# for which a ` ReceiveMessage ` action waits for a message to arrive.
|
664
|
+
# Valid values: An integer from 0 to 20 (seconds). Default: 0.
|
580
665
|
#
|
581
|
-
# * `
|
582
|
-
#
|
583
|
-
#
|
666
|
+
# * `VisibilityTimeout` – The visibility timeout for the queue, in
|
667
|
+
# seconds. Valid values: An integer from 0 to 43,200 (12 hours).
|
668
|
+
# Default: 30. For more information about the visibility timeout, see
|
669
|
+
# [Visibility Timeout][2] in the *Amazon SQS Developer Guide*.
|
584
670
|
#
|
585
|
-
#
|
586
|
-
# for which a ` ReceiveMessage ` action waits for a message to arrive.
|
587
|
-
# Valid values: an integer from 0 to 20 (seconds). Default: 0.
|
671
|
+
# The following attributes apply only to [dead-letter queues:][3]
|
588
672
|
#
|
589
|
-
# * `RedrivePolicy`
|
590
|
-
# dead-letter queue functionality of the source queue
|
591
|
-
#
|
592
|
-
# [Using Amazon SQS Dead-Letter Queues][2] in the *Amazon Simple Queue
|
593
|
-
# Service Developer Guide*.
|
673
|
+
# * `RedrivePolicy` – The string that includes the parameters for the
|
674
|
+
# dead-letter queue functionality of the source queue as a JSON
|
675
|
+
# object. The parameters are as follows:
|
594
676
|
#
|
595
|
-
# * `deadLetterTargetArn`
|
677
|
+
# * `deadLetterTargetArn` – The Amazon Resource Name (ARN) of the
|
596
678
|
# dead-letter queue to which Amazon SQS moves messages after the
|
597
679
|
# value of `maxReceiveCount` is exceeded.
|
598
680
|
#
|
599
|
-
# * `maxReceiveCount`
|
600
|
-
# the source queue before being moved to the dead-letter queue.
|
601
|
-
# the `ReceiveCount` for a message exceeds the
|
602
|
-
# a queue, Amazon SQS moves the message to the
|
681
|
+
# * `maxReceiveCount` – The number of times a message is delivered to
|
682
|
+
# the source queue before being moved to the dead-letter queue.
|
683
|
+
# Default: 10. When the `ReceiveCount` for a message exceeds the
|
684
|
+
# `maxReceiveCount` for a queue, Amazon SQS moves the message to the
|
685
|
+
# dead-letter-queue.
|
603
686
|
#
|
604
|
-
#
|
605
|
-
#
|
606
|
-
#
|
687
|
+
# * `RedriveAllowPolicy` – The string that includes the parameters for
|
688
|
+
# the permissions for the dead-letter queue redrive permission and
|
689
|
+
# which source queues can specify dead-letter queues as a JSON object.
|
690
|
+
# The parameters are as follows:
|
607
691
|
#
|
608
|
-
#
|
692
|
+
# * `redrivePermission` – The permission type that defines which
|
693
|
+
# source queues can specify the current queue as the dead-letter
|
694
|
+
# queue. Valid values are:
|
609
695
|
#
|
610
|
-
#
|
611
|
-
#
|
612
|
-
#
|
613
|
-
# [Visibility Timeout][3] in the *Amazon Simple Queue Service
|
614
|
-
# Developer Guide*.
|
696
|
+
# * `allowAll` – (Default) Any source queues in this Amazon Web
|
697
|
+
# Services account in the same Region can specify this queue as
|
698
|
+
# the dead-letter queue.
|
615
699
|
#
|
616
|
-
#
|
700
|
+
# * `denyAll` – No source queues can specify this queue as the
|
701
|
+
# dead-letter queue.
|
617
702
|
#
|
618
|
-
#
|
619
|
-
#
|
620
|
-
# Terms][5]. While the alias of the AWS-managed CMK for Amazon SQS is
|
621
|
-
# always `alias/aws/sqs`, the alias of a custom CMK can, for example,
|
622
|
-
# be `alias/MyAlias `. For more examples, see [KeyId][6] in the *AWS
|
623
|
-
# Key Management Service API Reference*.
|
703
|
+
# * `byQueue` – Only queues specified by the `sourceQueueArns`
|
704
|
+
# parameter can specify this queue as the dead-letter queue.
|
624
705
|
#
|
625
|
-
#
|
706
|
+
# * `sourceQueueArns` – The Amazon Resource Names (ARN)s of the source
|
707
|
+
# queues that can specify this queue as the dead-letter queue and
|
708
|
+
# redrive messages. You can specify this parameter only when the
|
709
|
+
# `redrivePermission` parameter is set to `byQueue`. You can specify
|
710
|
+
# up to 10 source queue ARNs. To allow more than 10 source queues to
|
711
|
+
# specify dead-letter queues, set the `redrivePermission` parameter
|
712
|
+
# to `allowAll`.
|
713
|
+
#
|
714
|
+
# <note markdown="1"> The dead-letter queue of a FIFO queue must also be a FIFO queue.
|
715
|
+
# Similarly, the dead-letter queue of a standard queue must also be a
|
716
|
+
# standard queue.
|
717
|
+
#
|
718
|
+
# </note>
|
719
|
+
#
|
720
|
+
# The following attributes apply only to [server-side-encryption][4]:
|
721
|
+
#
|
722
|
+
# * `KmsMasterKeyId` – The ID of an Amazon Web Services managed customer
|
723
|
+
# master key (CMK) for Amazon SQS or a custom CMK. For more
|
724
|
+
# information, see [Key Terms][5]. While the alias of the AWS-managed
|
725
|
+
# CMK for Amazon SQS is always `alias/aws/sqs`, the alias of a custom
|
726
|
+
# CMK can, for example, be `alias/MyAlias `. For more examples, see
|
727
|
+
# [KeyId][6] in the *Key Management Service API Reference*.
|
728
|
+
#
|
729
|
+
# * `KmsDataKeyReusePeriodSeconds` – The length of time, in seconds, for
|
626
730
|
# which Amazon SQS can reuse a [data key][7] to encrypt or decrypt
|
627
|
-
# messages before calling
|
628
|
-
#
|
629
|
-
#
|
630
|
-
#
|
631
|
-
#
|
632
|
-
#
|
731
|
+
# messages before calling KMS again. An integer representing seconds,
|
732
|
+
# between 60 seconds (1 minute) and 86,400 seconds (24 hours).
|
733
|
+
# Default: 300 (5 minutes). A shorter time period provides better
|
734
|
+
# security but results in more calls to KMS which might incur charges
|
735
|
+
# after Free Tier. For more information, see [How Does the Data Key
|
736
|
+
# Reuse Period Work?][8].
|
737
|
+
#
|
738
|
+
# * `SqsManagedSseEnabled` – Enables server-side queue encryption using
|
739
|
+
# SQS owned encryption keys. Only one server-side encryption option is
|
740
|
+
# supported per queue (for example, [SSE-KMS][9] or [SSE-SQS][10]).
|
633
741
|
#
|
634
742
|
# The following attribute applies only to [FIFO (first-in-first-out)
|
635
|
-
# queues][
|
743
|
+
# queues][11]:
|
636
744
|
#
|
637
|
-
# * `ContentBasedDeduplication`
|
638
|
-
# For more information, see [Exactly-
|
639
|
-
# *Amazon
|
745
|
+
# * `ContentBasedDeduplication` – Enables content-based deduplication.
|
746
|
+
# For more information, see [Exactly-once processing][12] in the
|
747
|
+
# *Amazon SQS Developer Guide*. Note the following:
|
640
748
|
#
|
641
|
-
# * Every message must have a unique `MessageDeduplicationId
|
749
|
+
# * Every message must have a unique `MessageDeduplicationId`.
|
642
750
|
#
|
643
751
|
# * You may provide a `MessageDeduplicationId` explicitly.
|
644
752
|
#
|
@@ -666,22 +774,54 @@ module Aws::SQS
|
|
666
774
|
# `MessageDeduplicationId`, the two messages are treated as
|
667
775
|
# duplicates and only one copy of the message is delivered.
|
668
776
|
#
|
777
|
+
# The following attributes apply only to [high throughput for FIFO
|
778
|
+
# queues][13]:
|
779
|
+
#
|
780
|
+
# * `DeduplicationScope` – Specifies whether message deduplication
|
781
|
+
# occurs at the message group or queue level. Valid values are
|
782
|
+
# `messageGroup` and `queue`.
|
783
|
+
#
|
784
|
+
# * `FifoThroughputLimit` – Specifies whether the FIFO queue throughput
|
785
|
+
# quota applies to the entire queue or per message group. Valid values
|
786
|
+
# are `perQueue` and `perMessageGroupId`. The `perMessageGroupId`
|
787
|
+
# value is allowed only when the value for `DeduplicationScope` is
|
788
|
+
# `messageGroup`.
|
789
|
+
#
|
790
|
+
# To enable high throughput for FIFO queues, do the following:
|
669
791
|
#
|
792
|
+
# * Set `DeduplicationScope` to `messageGroup`.
|
670
793
|
#
|
671
|
-
#
|
672
|
-
#
|
673
|
-
#
|
674
|
-
#
|
675
|
-
#
|
676
|
-
#
|
677
|
-
# [
|
678
|
-
# [
|
679
|
-
#
|
680
|
-
#
|
794
|
+
# * Set `FifoThroughputLimit` to `perMessageGroupId`.
|
795
|
+
#
|
796
|
+
# If you set these attributes to anything other than the values shown
|
797
|
+
# for enabling high throughput, normal throughput is in effect and
|
798
|
+
# deduplication occurs as specified.
|
799
|
+
#
|
800
|
+
# For information on throughput quotas, see [Quotas related to
|
801
|
+
# messages][14] in the *Amazon SQS Developer Guide*.
|
802
|
+
#
|
803
|
+
#
|
804
|
+
#
|
805
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html
|
806
|
+
# [2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
|
807
|
+
# [3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
|
808
|
+
# [4]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html
|
809
|
+
# [5]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms
|
810
|
+
# [6]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
|
811
|
+
# [7]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys
|
812
|
+
# [8]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work
|
813
|
+
# [9]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html
|
814
|
+
# [10]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html
|
815
|
+
# [11]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
|
816
|
+
# [12]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html
|
817
|
+
# [13]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html
|
818
|
+
# [14]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html
|
681
819
|
# @return [EmptyStructure]
|
682
820
|
def set_attributes(options = {})
|
683
821
|
options = options.merge(queue_url: @url)
|
684
|
-
resp =
|
822
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
823
|
+
@client.set_queue_attributes(options)
|
824
|
+
end
|
685
825
|
resp.data
|
686
826
|
end
|
687
827
|
|
@@ -694,16 +834,20 @@ module Aws::SQS
|
|
694
834
|
# @return [Queue::Collection]
|
695
835
|
def dead_letter_source_queues(options = {})
|
696
836
|
batches = Enumerator.new do |y|
|
697
|
-
batch = []
|
698
837
|
options = options.merge(queue_url: @url)
|
699
|
-
resp =
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
838
|
+
resp = Aws::Plugins::UserAgent.feature('resource') do
|
839
|
+
@client.list_dead_letter_source_queues(options)
|
840
|
+
end
|
841
|
+
resp.each_page do |page|
|
842
|
+
batch = []
|
843
|
+
page.data.queue_urls.each do |q|
|
844
|
+
batch << Queue.new(
|
845
|
+
url: q,
|
846
|
+
client: @client
|
847
|
+
)
|
848
|
+
end
|
849
|
+
y.yield(batch)
|
705
850
|
end
|
706
|
-
y.yield(batch)
|
707
851
|
end
|
708
852
|
Queue::Collection.new(batches)
|
709
853
|
end
|