aws-sdk-sqs 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-sqs.rb +1 -1
- data/lib/aws-sdk-sqs/client.rb +1748 -1547
- data/lib/aws-sdk-sqs/client_api.rb +454 -456
- data/lib/aws-sdk-sqs/errors.rb +4 -13
- data/lib/aws-sdk-sqs/message.rb +198 -203
- data/lib/aws-sdk-sqs/plugins/md5s.rb +1 -1
- data/lib/aws-sdk-sqs/queue.rb +738 -684
- data/lib/aws-sdk-sqs/resource.rb +210 -201
- data/lib/aws-sdk-sqs/types.rb +1753 -1597
- metadata +2 -2
data/lib/aws-sdk-sqs/queue.rb
CHANGED
@@ -1,724 +1,778 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
class Queue
|
8
|
+
module Aws::SQS
|
9
|
+
class Queue
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Deprecations
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
13
|
+
# @overload def initialize(url, options = {})
|
14
|
+
# @param [String] url
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :url
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@url = extract_url(args, options)
|
22
|
+
@data = options.delete(:data)
|
23
|
+
@client = options.delete(:client) || Client.new(options)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
# @return [String]
|
29
|
+
def url
|
30
|
+
@url
|
31
|
+
end
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
# A map of attributes to their respective values.
|
34
|
+
# @return [Hash<String,String>]
|
35
|
+
def attributes
|
36
|
+
data.attributes
|
37
|
+
end
|
39
38
|
|
40
|
-
|
39
|
+
# @!endgroup
|
41
40
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
# @return [Client]
|
42
|
+
def client
|
43
|
+
@client
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
46
|
+
# Loads, or reloads {#data} for the current {Queue}.
|
47
|
+
# Returns `self` making it possible to chain methods.
|
48
|
+
#
|
49
|
+
# queue.reload.data
|
50
|
+
#
|
51
|
+
# @return [self]
|
52
|
+
def load
|
53
|
+
resp = @client.get_queue_attributes(
|
54
|
+
queue_url: @url,
|
55
|
+
attribute_names: ["All"]
|
56
|
+
)
|
57
|
+
@data = resp.data
|
58
|
+
self
|
59
|
+
end
|
60
|
+
alias :reload :load
|
62
61
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
62
|
+
# @return [Types::GetQueueAttributesResult]
|
63
|
+
# Returns the data for this {Queue}. Calls
|
64
|
+
# {Client#get_queue_attributes} if {#data_loaded?} is `false`.
|
65
|
+
def data
|
66
|
+
load unless @data
|
67
|
+
@data
|
68
|
+
end
|
70
69
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
70
|
+
# @return [Boolean]
|
71
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
72
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
73
|
+
def data_loaded?
|
74
|
+
!!@data
|
75
|
+
end
|
77
76
|
|
78
|
-
|
77
|
+
# @!group Actions
|
79
78
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
79
|
+
# @example Request syntax with placeholder values
|
80
|
+
#
|
81
|
+
# queue.add_permission({
|
82
|
+
# label: "String", # required
|
83
|
+
# aws_account_ids: ["String"], # required
|
84
|
+
# actions: ["String"], # required
|
85
|
+
# })
|
86
|
+
# @param [Hash] options ({})
|
87
|
+
# @option options [required, String] :label
|
88
|
+
# The unique identification of the permission you're setting (for
|
89
|
+
# example, `AliceSendMessage`). Maximum 80 characters. Allowed
|
90
|
+
# characters include alphanumeric characters, hyphens (`-`), and
|
91
|
+
# underscores (`_`).
|
92
|
+
# @option options [required, Array<String>] :aws_account_ids
|
93
|
+
# The AWS account number of the [principal][1] who is given permission.
|
94
|
+
# The principal must have an AWS account, but does not need to be signed
|
95
|
+
# up for Amazon SQS. For information about locating the AWS account
|
96
|
+
# identification, see [Your AWS Identifiers][2] in the *Amazon SQS
|
97
|
+
# Developer Guide*.
|
98
|
+
#
|
99
|
+
#
|
100
|
+
#
|
101
|
+
# [1]: http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P
|
102
|
+
# [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AWSCredentials.html
|
103
|
+
# @option options [required, Array<String>] :actions
|
104
|
+
# The action the client wants to allow for the specified principal. The
|
105
|
+
# following values are valid:
|
106
|
+
#
|
107
|
+
# * `*`
|
108
|
+
#
|
109
|
+
# * `ChangeMessageVisibility`
|
110
|
+
#
|
111
|
+
# * `DeleteMessage`
|
112
|
+
#
|
113
|
+
# * `GetQueueAttributes`
|
114
|
+
#
|
115
|
+
# * `GetQueueUrl`
|
116
|
+
#
|
117
|
+
# * `ReceiveMessage`
|
118
|
+
#
|
119
|
+
# * `SendMessage`
|
120
|
+
#
|
121
|
+
# For more information about these actions, see [Understanding
|
122
|
+
# Permissions][1] in the *Amazon SQS Developer Guide*.
|
123
|
+
#
|
124
|
+
# Specifying `SendMessage`, `DeleteMessage`, or
|
125
|
+
# `ChangeMessageVisibility` for `ActionName.n` also grants permissions
|
126
|
+
# for the corresponding batch versions of those actions:
|
127
|
+
# `SendMessageBatch`, `DeleteMessageBatch`, and
|
128
|
+
# `ChangeMessageVisibilityBatch`.
|
129
|
+
#
|
130
|
+
#
|
131
|
+
#
|
132
|
+
# [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html#PermissionTypes
|
133
|
+
# @return [EmptyStructure]
|
134
|
+
def add_permission(options = {})
|
135
|
+
options = options.merge(queue_url: @url)
|
136
|
+
resp = @client.add_permission(options)
|
137
|
+
resp.data
|
138
|
+
end
|
125
139
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
140
|
+
# @example Request syntax with placeholder values
|
141
|
+
#
|
142
|
+
# queue.change_message_visibility_batch({
|
143
|
+
# entries: [ # required
|
144
|
+
# {
|
145
|
+
# id: "String", # required
|
146
|
+
# receipt_handle: "String", # required
|
147
|
+
# visibility_timeout: 1,
|
148
|
+
# },
|
149
|
+
# ],
|
150
|
+
# })
|
151
|
+
# @param [Hash] options ({})
|
152
|
+
# @option options [required, Array<Types::ChangeMessageVisibilityBatchRequestEntry>] :entries
|
153
|
+
# A list of receipt handles of the messages for which the visibility
|
154
|
+
# timeout must be changed.
|
155
|
+
# @return [Types::ChangeMessageVisibilityBatchResult]
|
156
|
+
def change_message_visibility_batch(options = {})
|
157
|
+
options = options.merge(queue_url: @url)
|
158
|
+
resp = @client.change_message_visibility_batch(options)
|
159
|
+
resp.data
|
160
|
+
end
|
147
161
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
162
|
+
# @example Request syntax with placeholder values
|
163
|
+
#
|
164
|
+
# queue.delete()
|
165
|
+
# @param [Hash] options ({})
|
166
|
+
# @return [EmptyStructure]
|
167
|
+
def delete(options = {})
|
168
|
+
options = options.merge(queue_url: @url)
|
169
|
+
resp = @client.delete_queue(options)
|
170
|
+
resp.data
|
171
|
+
end
|
158
172
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
173
|
+
# @example Request syntax with placeholder values
|
174
|
+
#
|
175
|
+
# queue.delete_messages({
|
176
|
+
# entries: [ # required
|
177
|
+
# {
|
178
|
+
# id: "String", # required
|
179
|
+
# receipt_handle: "String", # required
|
180
|
+
# },
|
181
|
+
# ],
|
182
|
+
# })
|
183
|
+
# @param [Hash] options ({})
|
184
|
+
# @option options [required, Array<Types::DeleteMessageBatchRequestEntry>] :entries
|
185
|
+
# A list of receipt handles for the messages to be deleted.
|
186
|
+
# @return [Types::DeleteMessageBatchResult]
|
187
|
+
def delete_messages(options = {})
|
188
|
+
options = options.merge(queue_url: @url)
|
189
|
+
resp = @client.delete_message_batch(options)
|
190
|
+
resp.data
|
191
|
+
end
|
178
192
|
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
193
|
+
# @example Request syntax with placeholder values
|
194
|
+
#
|
195
|
+
# queue.purge()
|
196
|
+
# @param [Hash] options ({})
|
197
|
+
# @return [EmptyStructure]
|
198
|
+
def purge(options = {})
|
199
|
+
options = options.merge(queue_url: @url)
|
200
|
+
resp = @client.purge_queue(options)
|
201
|
+
resp.data
|
202
|
+
end
|
189
203
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
204
|
+
# @example Request syntax with placeholder values
|
205
|
+
#
|
206
|
+
# message = queue.receive_messages({
|
207
|
+
# attribute_names: ["All"], # accepts All, Policy, VisibilityTimeout, MaximumMessageSize, MessageRetentionPeriod, ApproximateNumberOfMessages, ApproximateNumberOfMessagesNotVisible, CreatedTimestamp, LastModifiedTimestamp, QueueArn, ApproximateNumberOfMessagesDelayed, DelaySeconds, ReceiveMessageWaitTimeSeconds, RedrivePolicy, FifoQueue, ContentBasedDeduplication
|
208
|
+
# message_attribute_names: ["MessageAttributeName"],
|
209
|
+
# max_number_of_messages: 1,
|
210
|
+
# visibility_timeout: 1,
|
211
|
+
# wait_time_seconds: 1,
|
212
|
+
# receive_request_attempt_id: "String",
|
213
|
+
# })
|
214
|
+
# @param [Hash] options ({})
|
215
|
+
# @option options [Array<String>] :attribute_names
|
216
|
+
# A list of attributes that need to be returned along with each message.
|
217
|
+
# These attributes include:
|
218
|
+
#
|
219
|
+
# * `All` - Returns all values.
|
220
|
+
#
|
221
|
+
# * `ApproximateFirstReceiveTimestamp` - Returns the time the message
|
222
|
+
# was first received from the queue ([epoch time][1] in milliseconds).
|
223
|
+
#
|
224
|
+
# * `ApproximateReceiveCount` - Returns the number of times a message
|
225
|
+
# has been received from the queue but not deleted.
|
226
|
+
#
|
227
|
+
# * `SenderId`
|
228
|
+
#
|
229
|
+
# * For an IAM user, returns the IAM user ID, for example
|
230
|
+
# `ABCDEFGHI1JKLMNOPQ23R`.
|
231
|
+
#
|
232
|
+
# * For an IAM role, returns the IAM role ID, for example
|
233
|
+
# `ABCDE1F2GH3I4JK5LMNOP:i-a123b456`.
|
234
|
+
#
|
235
|
+
# * `SentTimestamp` - Returns the time the message was sent to the queue
|
236
|
+
# ([epoch time][1] in milliseconds).
|
237
|
+
#
|
238
|
+
# * `MessageDeduplicationId` - Returns the value provided by the sender
|
239
|
+
# that calls the ` SendMessage ` action.
|
240
|
+
#
|
241
|
+
# * `MessageGroupId` - Returns the value provided by the sender that
|
242
|
+
# calls the ` SendMessage ` action. Messages with the same
|
243
|
+
# `MessageGroupId` are returned in sequence.
|
244
|
+
#
|
245
|
+
# * `SequenceNumber` - Returns the value provided by Amazon SQS.
|
246
|
+
#
|
247
|
+
# Any other valid special request parameters (such as the following) are
|
248
|
+
# ignored:
|
249
|
+
#
|
250
|
+
# * `ApproximateNumberOfMessages`
|
251
|
+
#
|
252
|
+
# * `ApproximateNumberOfMessagesDelayed`
|
253
|
+
#
|
254
|
+
# * `ApproximateNumberOfMessagesNotVisible`
|
255
|
+
#
|
256
|
+
# * `CreatedTimestamp`
|
257
|
+
#
|
258
|
+
# * `ContentBasedDeduplication`
|
259
|
+
#
|
260
|
+
# * `DelaySeconds`
|
261
|
+
#
|
262
|
+
# * `FifoQueue`
|
263
|
+
#
|
264
|
+
# * `LastModifiedTimestamp`
|
265
|
+
#
|
266
|
+
# * `MaximumMessageSize`
|
267
|
+
#
|
268
|
+
# * `MessageRetentionPeriod`
|
269
|
+
#
|
270
|
+
# * `Policy`
|
271
|
+
#
|
272
|
+
# * `QueueArn`,
|
273
|
+
#
|
274
|
+
# * `ReceiveMessageWaitTimeSeconds`
|
275
|
+
#
|
276
|
+
# * `RedrivePolicy`
|
277
|
+
#
|
278
|
+
# * `VisibilityTimeout`
|
279
|
+
#
|
280
|
+
#
|
281
|
+
#
|
282
|
+
# [1]: http://en.wikipedia.org/wiki/Unix_time
|
283
|
+
# @option options [Array<String>] :message_attribute_names
|
284
|
+
# The name of the message attribute, where *N* is the index.
|
285
|
+
#
|
286
|
+
# * The name can contain alphanumeric characters and the underscore
|
287
|
+
# (`_`), hyphen (`-`), and period (`.`).
|
288
|
+
#
|
289
|
+
# * The name is case-sensitive and must be unique among all attribute
|
290
|
+
# names for the message.
|
291
|
+
#
|
292
|
+
# * The name must not start with AWS-reserved prefixes such as `AWS.` or
|
293
|
+
# `Amazon.` (or any casing variants).
|
294
|
+
#
|
295
|
+
# * The name must not start or end with a period (`.`), and it should
|
296
|
+
# not have periods in succession (`..`).
|
297
|
+
#
|
298
|
+
# * The name can be up to 256 characters long.
|
299
|
+
#
|
300
|
+
# When using `ReceiveMessage`, you can send a list of attribute names to
|
301
|
+
# receive, or you can return all of the attributes by specifying `All`
|
302
|
+
# or `.*` in your request. You can also use all message attributes
|
303
|
+
# starting with a prefix, for example `bar.*`.
|
304
|
+
# @option options [Integer] :max_number_of_messages
|
305
|
+
# The maximum number of messages to return. Amazon SQS never returns
|
306
|
+
# more messages than this value (however, fewer messages might be
|
307
|
+
# returned). Valid values are 1 to 10. Default is 1.
|
308
|
+
# @option options [Integer] :visibility_timeout
|
309
|
+
# The duration (in seconds) that the received messages are hidden from
|
310
|
+
# subsequent retrieve requests after being retrieved by a
|
311
|
+
# `ReceiveMessage` request.
|
312
|
+
# @option options [Integer] :wait_time_seconds
|
313
|
+
# The duration (in seconds) for which the call waits for a message to
|
314
|
+
# arrive in the queue before returning. If a message is available, the
|
315
|
+
# call returns sooner than `WaitTimeSeconds`.
|
316
|
+
# @option options [String] :receive_request_attempt_id
|
317
|
+
# This parameter applies only to FIFO (first-in-first-out) queues.
|
318
|
+
#
|
319
|
+
# The token used for deduplication of `ReceiveMessage` calls. If a
|
320
|
+
# networking issue occurs after a `ReceiveMessage` action, and instead
|
321
|
+
# of a response you receive a generic error, you can retry the same
|
322
|
+
# action with an identical `ReceiveRequestAttemptId` to retrieve the
|
323
|
+
# same set of messages, even if their visibility timeout has not yet
|
324
|
+
# expired.
|
325
|
+
#
|
326
|
+
# * You can use `ReceiveRequestAttemptId` only for 5 minutes after a
|
327
|
+
# `ReceiveMessage` action.
|
328
|
+
#
|
329
|
+
# * When you set `FifoQueue`, a caller of the `ReceiveMessage` action
|
330
|
+
# can provide a `ReceiveRequestAttemptId` explicitly.
|
331
|
+
#
|
332
|
+
# * If a caller of the `ReceiveMessage` action doesn't provide a
|
333
|
+
# `ReceiveRequestAttemptId`, Amazon SQS generates a
|
334
|
+
# `ReceiveRequestAttemptId`.
|
335
|
+
#
|
336
|
+
# * You can retry the `ReceiveMessage` action with the same
|
337
|
+
# `ReceiveRequestAttemptId` if none of the messages have been modified
|
338
|
+
# (deleted or had their visibility changes).
|
339
|
+
#
|
340
|
+
# * During a visibility timeout, subsequent calls with the same
|
341
|
+
# `ReceiveRequestAttemptId` return the same messages and receipt
|
342
|
+
# handles. If a retry occurs within the deduplication interval, it
|
343
|
+
# resets the visibility timeout. For more information, see [Visibility
|
344
|
+
# Timeout][1] in the *Amazon Simple Queue Service Developer Guide*.
|
345
|
+
#
|
346
|
+
# If a caller of the `ReceiveMessage` action is still processing
|
347
|
+
# messages when the visibility timeout expires and messages become
|
348
|
+
# visible, another worker reading from the same queue can receive the
|
349
|
+
# same messages and therefore process duplicates. Also, if a reader
|
350
|
+
# whose message processing time is longer than the visibility timeout
|
351
|
+
# tries to delete the processed messages, the action fails with an
|
352
|
+
# error.
|
353
|
+
#
|
354
|
+
# To mitigate this effect, ensure that your application observes a
|
355
|
+
# safe threshold before the visibility timeout expires and extend the
|
356
|
+
# visibility timeout as necessary.
|
357
|
+
#
|
358
|
+
# * While messages with a particular `MessageGroupId` are invisible, no
|
359
|
+
# more messages belonging to the same `MessageGroupId` are returned
|
360
|
+
# until the visibility timeout expires. You can still receive messages
|
361
|
+
# with another `MessageGroupId` as long as it is also visible.
|
362
|
+
#
|
363
|
+
# * If a caller of `ReceiveMessage` can't track the
|
364
|
+
# `ReceiveRequestAttemptId`, no retries work until the original
|
365
|
+
# visibility timeout expires. As a result, delays might occur but the
|
366
|
+
# messages in the queue remain in a strict order.
|
367
|
+
#
|
368
|
+
# The length of `ReceiveRequestAttemptId` is 128 characters.
|
369
|
+
# `ReceiveRequestAttemptId` can contain alphanumeric characters (`a-z`,
|
370
|
+
# `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~
|
371
|
+
# ``).
|
372
|
+
#
|
373
|
+
# For best practices of using `ReceiveRequestAttemptId`, see [Using the
|
374
|
+
# ReceiveRequestAttemptId Request Parameter][2] in the *Amazon Simple
|
375
|
+
# Queue Service Developer Guide*.
|
376
|
+
#
|
377
|
+
#
|
378
|
+
#
|
379
|
+
# [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
|
380
|
+
# [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queue-recommendations.html#using-receiverequestattemptid-request-parameter
|
381
|
+
# @return [Message::Collection]
|
382
|
+
def receive_messages(options = {})
|
383
|
+
batch = []
|
384
|
+
options = options.merge(queue_url: @url)
|
385
|
+
resp = @client.receive_message(options)
|
386
|
+
resp.data.messages.each do |m|
|
387
|
+
batch << Message.new(
|
388
|
+
queue_url: @url,
|
389
|
+
receipt_handle: m.receipt_handle,
|
390
|
+
data: m,
|
391
|
+
client: @client
|
392
|
+
)
|
373
393
|
end
|
394
|
+
Message::Collection.new([batch], size: batch.size)
|
395
|
+
end
|
374
396
|
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
397
|
+
# @example Request syntax with placeholder values
|
398
|
+
#
|
399
|
+
# queue.remove_permission({
|
400
|
+
# label: "String", # required
|
401
|
+
# })
|
402
|
+
# @param [Hash] options ({})
|
403
|
+
# @option options [required, String] :label
|
404
|
+
# The identification of the permission to remove. This is the label
|
405
|
+
# added using the ` AddPermission ` action.
|
406
|
+
# @return [EmptyStructure]
|
407
|
+
def remove_permission(options = {})
|
408
|
+
options = options.merge(queue_url: @url)
|
409
|
+
resp = @client.remove_permission(options)
|
410
|
+
resp.data
|
411
|
+
end
|
390
412
|
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
413
|
+
# @example Request syntax with placeholder values
|
414
|
+
#
|
415
|
+
# queue.send_message({
|
416
|
+
# message_body: "String", # required
|
417
|
+
# delay_seconds: 1,
|
418
|
+
# message_attributes: {
|
419
|
+
# "String" => {
|
420
|
+
# string_value: "String",
|
421
|
+
# binary_value: "data",
|
422
|
+
# string_list_values: ["String"],
|
423
|
+
# binary_list_values: ["data"],
|
424
|
+
# data_type: "String", # required
|
425
|
+
# },
|
426
|
+
# },
|
427
|
+
# message_deduplication_id: "String",
|
428
|
+
# message_group_id: "String",
|
429
|
+
# })
|
430
|
+
# @param [Hash] options ({})
|
431
|
+
# @option options [required, String] :message_body
|
432
|
+
# The message to send. The maximum string size is 256 KB.
|
433
|
+
#
|
434
|
+
# The following list shows the characters (in Unicode) that are allowed
|
435
|
+
# in your message, according to the W3C XML specification:
|
436
|
+
#
|
437
|
+
# * `#x9`
|
438
|
+
#
|
439
|
+
# * `#xA`
|
440
|
+
#
|
441
|
+
# * `#xD`
|
442
|
+
#
|
443
|
+
# * `#x20` to `#xD7FF`
|
444
|
+
#
|
445
|
+
# * `#xE000` to `#xFFFD`
|
446
|
+
#
|
447
|
+
# * `#x10000` to `#x10FFFF`
|
448
|
+
#
|
449
|
+
# For more information, see [RFC1321][1]. If you send any characters
|
450
|
+
# that aren't included in this list, your request is rejected.
|
451
|
+
#
|
452
|
+
#
|
453
|
+
#
|
454
|
+
# [1]: https://www.ietf.org/rfc/rfc1321.txt
|
455
|
+
# @option options [Integer] :delay_seconds
|
456
|
+
# The number of seconds to delay a specific message. Valid values: 0 to
|
457
|
+
# 900. Maximum: 15 minutes. Messages with a positive `DelaySeconds`
|
458
|
+
# value become available for processing after the delay period is
|
459
|
+
# finished. If you don't specify a value, the default value for the
|
460
|
+
# queue applies.
|
461
|
+
#
|
462
|
+
# <note markdown="1"> When you set `FifoQueue`, you can't set `DelaySeconds` per message.
|
463
|
+
# You can set this parameter only on a queue level.
|
464
|
+
#
|
465
|
+
# </note>
|
466
|
+
# @option options [Hash<String,Types::MessageAttributeValue>] :message_attributes
|
467
|
+
# Each message attribute consists of a `Name`, `Type`, and `Value`. For
|
468
|
+
# more information, see [Message Attribute Items and Validation][1] in
|
469
|
+
# the *Amazon SQS Developer Guide*.
|
470
|
+
#
|
471
|
+
#
|
472
|
+
#
|
473
|
+
# [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html#message-attributes-items-validation
|
474
|
+
# @option options [String] :message_deduplication_id
|
475
|
+
# This parameter applies only to FIFO (first-in-first-out) queues.
|
476
|
+
#
|
477
|
+
# The token used for deduplication of sent messages. If a message with a
|
478
|
+
# particular `MessageDeduplicationId` is sent successfully, any messages
|
479
|
+
# sent with the same `MessageDeduplicationId` are accepted successfully
|
480
|
+
# but aren't delivered during the 5-minute deduplication interval. For
|
481
|
+
# more information, see [ Exactly-Once Processing][1] in the *Amazon SQS
|
482
|
+
# Developer Guide*.
|
483
|
+
#
|
484
|
+
# * Every message must have a unique `MessageDeduplicationId`,
|
485
|
+
#
|
486
|
+
# * You may provide a `MessageDeduplicationId` explicitly.
|
487
|
+
#
|
488
|
+
# * If you aren't able to provide a `MessageDeduplicationId` and you
|
489
|
+
# enable `ContentBasedDeduplication` for your queue, Amazon SQS uses
|
490
|
+
# a SHA-256 hash to generate the `MessageDeduplicationId` using the
|
491
|
+
# body of the message (but not the attributes of the message).
|
492
|
+
#
|
493
|
+
# * If you don't provide a `MessageDeduplicationId` and the queue
|
494
|
+
# doesn't have `ContentBasedDeduplication` set, the action fails
|
495
|
+
# with an error.
|
496
|
+
#
|
497
|
+
# * If the queue has `ContentBasedDeduplication` set, your
|
498
|
+
# `MessageDeduplicationId` overrides the generated one.
|
499
|
+
#
|
500
|
+
# * When `ContentBasedDeduplication` is in effect, messages with
|
501
|
+
# identical content sent within the deduplication interval are treated
|
502
|
+
# as duplicates and only one copy of the message is delivered.
|
503
|
+
#
|
504
|
+
# * You can also use `ContentBasedDeduplication` for messages with
|
505
|
+
# identical content to be treated as duplicates.
|
506
|
+
#
|
507
|
+
# * If you send one message with `ContentBasedDeduplication` enabled and
|
508
|
+
# then another message with a `MessageDeduplicationId` that is the
|
509
|
+
# same as the one generated for the first `MessageDeduplicationId`,
|
510
|
+
# the two messages are treated as duplicates and only one copy of the
|
511
|
+
# message is delivered.
|
512
|
+
#
|
513
|
+
# <note markdown="1"> The `MessageDeduplicationId` is available to the recipient of the
|
514
|
+
# message (this can be useful for troubleshooting delivery issues).
|
515
|
+
#
|
516
|
+
# If a message is sent successfully but the acknowledgement is lost and
|
517
|
+
# the message is resent with the same `MessageDeduplicationId` after the
|
518
|
+
# deduplication interval, Amazon SQS can't detect duplicate messages.
|
519
|
+
#
|
520
|
+
# </note>
|
521
|
+
#
|
522
|
+
# The length of `MessageDeduplicationId` is 128 characters.
|
523
|
+
# `MessageDeduplicationId` can contain alphanumeric characters (`a-z`,
|
524
|
+
# `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~
|
525
|
+
# ``).
|
526
|
+
#
|
527
|
+
# For best practices of using `MessageDeduplicationId`, see [Using the
|
528
|
+
# MessageDeduplicationId Property][2] in the *Amazon Simple Queue
|
529
|
+
# Service Developer Guide*.
|
530
|
+
#
|
531
|
+
#
|
532
|
+
#
|
533
|
+
# [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
|
534
|
+
# [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queue-recommendations.html#using-messagededuplicationid-property
|
535
|
+
# @option options [String] :message_group_id
|
536
|
+
# This parameter applies only to FIFO (first-in-first-out) queues.
|
537
|
+
#
|
538
|
+
# The tag that specifies that a message belongs to a specific message
|
539
|
+
# group. Messages that belong to the same message group are processed in
|
540
|
+
# a FIFO manner (however, messages in different message groups might be
|
541
|
+
# processed out of order). To interleave multiple ordered streams within
|
542
|
+
# a single queue, use `MessageGroupId` values (for example, session data
|
543
|
+
# for multiple users). In this scenario, multiple readers can process
|
544
|
+
# the queue, but the session data of each user is processed in a FIFO
|
545
|
+
# fashion.
|
546
|
+
#
|
547
|
+
# * You must associate a non-empty `MessageGroupId` with a message. If
|
548
|
+
# you don't provide a `MessageGroupId`, the action fails.
|
549
|
+
#
|
550
|
+
# * `ReceiveMessage` might return messages with multiple
|
551
|
+
# `MessageGroupId` values. For each `MessageGroupId`, the messages are
|
552
|
+
# sorted by time sent. The caller can't specify a `MessageGroupId`.
|
553
|
+
#
|
554
|
+
# The length of `MessageGroupId` is 128 characters. Valid values are
|
555
|
+
# alphanumeric characters and punctuation ``
|
556
|
+
# (!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
|
557
|
+
#
|
558
|
+
# For best practices of using `MessageGroupId`, see [Using the
|
559
|
+
# MessageGroupId Property][1] in the *Amazon Simple Queue Service
|
560
|
+
# Developer Guide*.
|
561
|
+
#
|
562
|
+
#
|
563
|
+
#
|
564
|
+
# [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queue-recommendations.html#using-messagegroupid-property
|
565
|
+
# @return [Types::SendMessageResult]
|
566
|
+
def send_message(options = {})
|
567
|
+
options = options.merge(queue_url: @url)
|
568
|
+
resp = @client.send_message(options)
|
569
|
+
resp.data
|
570
|
+
end
|
527
571
|
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
572
|
+
# @example Request syntax with placeholder values
|
573
|
+
#
|
574
|
+
# queue.send_messages({
|
575
|
+
# entries: [ # required
|
576
|
+
# {
|
577
|
+
# id: "String", # required
|
578
|
+
# message_body: "String", # required
|
579
|
+
# delay_seconds: 1,
|
580
|
+
# message_attributes: {
|
581
|
+
# "String" => {
|
582
|
+
# string_value: "String",
|
583
|
+
# binary_value: "data",
|
584
|
+
# string_list_values: ["String"],
|
585
|
+
# binary_list_values: ["data"],
|
586
|
+
# data_type: "String", # required
|
587
|
+
# },
|
588
|
+
# },
|
589
|
+
# message_deduplication_id: "String",
|
590
|
+
# message_group_id: "String",
|
591
|
+
# },
|
592
|
+
# ],
|
593
|
+
# })
|
594
|
+
# @param [Hash] options ({})
|
595
|
+
# @option options [required, Array<Types::SendMessageBatchRequestEntry>] :entries
|
596
|
+
# A list of ` SendMessageBatchRequestEntry ` items.
|
597
|
+
# @return [Types::SendMessageBatchResult]
|
598
|
+
def send_messages(options = {})
|
599
|
+
options = options.merge(queue_url: @url)
|
600
|
+
resp = @client.send_message_batch(options)
|
601
|
+
resp.data
|
602
|
+
end
|
559
603
|
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
604
|
+
# @example Request syntax with placeholder values
|
605
|
+
#
|
606
|
+
# queue.set_attributes({
|
607
|
+
# attributes: { # required
|
608
|
+
# "All" => "String",
|
609
|
+
# },
|
610
|
+
# })
|
611
|
+
# @param [Hash] options ({})
|
612
|
+
# @option options [required, Hash<String,String>] :attributes
|
613
|
+
# A map of attributes to set.
|
614
|
+
#
|
615
|
+
# The following lists the names, descriptions, and values of the special
|
616
|
+
# request parameters that the `SetQueueAttributes` action uses:
|
617
|
+
#
|
618
|
+
# * `DelaySeconds` - The number of seconds for which the delivery of all
|
619
|
+
# messages in the queue is delayed. Valid values: An integer from 0 to
|
620
|
+
# 900 (15 minutes). The default is 0 (zero).
|
621
|
+
#
|
622
|
+
# * `MaximumMessageSize` - The limit of how many bytes a message can
|
623
|
+
# contain before Amazon SQS rejects it. Valid values: An integer from
|
624
|
+
# 1,024 bytes (1 KiB) up to 262,144 bytes (256 KiB). The default is
|
625
|
+
# 262,144 (256 KiB).
|
626
|
+
#
|
627
|
+
# * `MessageRetentionPeriod` - The number of seconds for which Amazon
|
628
|
+
# SQS retains a message. Valid values: An integer representing
|
629
|
+
# seconds, from 60 (1 minute) to 1,209,600 (14 days). The default is
|
630
|
+
# 345,600 (4 days).
|
631
|
+
#
|
632
|
+
# * `Policy` - The queue's policy. A valid AWS policy. For more
|
633
|
+
# information about policy structure, see [Overview of AWS IAM
|
634
|
+
# Policies][1] in the *Amazon IAM User Guide*.
|
635
|
+
#
|
636
|
+
# * `ReceiveMessageWaitTimeSeconds` - The number of seconds for which a
|
637
|
+
# ` ReceiveMessage ` action waits for a message to arrive. Valid
|
638
|
+
# values: an integer from 0 to 20 (seconds). The default is 0.
|
639
|
+
#
|
640
|
+
# * `RedrivePolicy` - The parameters for the dead letter queue
|
641
|
+
# functionality of the source queue. For more information about the
|
642
|
+
# redrive policy and dead letter queues, see [Using Amazon SQS Dead
|
643
|
+
# Letter Queues][2] in the *Amazon SQS Developer Guide*.
|
644
|
+
#
|
645
|
+
# <note markdown="1"> The dead letter queue of a FIFO queue must also be a FIFO queue.
|
646
|
+
# Similarly, the dead letter queue of a standard queue must also be a
|
647
|
+
# standard queue.
|
648
|
+
#
|
649
|
+
# </note>
|
650
|
+
#
|
651
|
+
# * `VisibilityTimeout` - The visibility timeout for the queue. Valid
|
652
|
+
# values: an integer from 0 to 43,200 (12 hours). The default is 30.
|
653
|
+
# For more information about the visibility timeout, see [Visibility
|
654
|
+
# Timeout][3] in the *Amazon SQS Developer Guide*.
|
655
|
+
#
|
656
|
+
# The following attribute applies only to [FIFO (first-in-first-out)
|
657
|
+
# queues][4]\:
|
658
|
+
#
|
659
|
+
# * `ContentBasedDeduplication` - Enables content-based deduplication.
|
660
|
+
# For more information, see [Exactly-Once Processing][5] in the
|
661
|
+
# *Amazon SQS Developer Guide*.
|
662
|
+
#
|
663
|
+
# * Every message must have a unique `MessageDeduplicationId`,
|
664
|
+
#
|
665
|
+
# * You may provide a `MessageDeduplicationId` explicitly.
|
666
|
+
#
|
667
|
+
# * If you aren't able to provide a `MessageDeduplicationId` and
|
668
|
+
# you enable `ContentBasedDeduplication` for your queue, Amazon
|
669
|
+
# SQS uses a SHA-256 hash to generate the `MessageDeduplicationId`
|
670
|
+
# using the body of the message (but not the attributes of the
|
671
|
+
# message).
|
672
|
+
#
|
673
|
+
# * If you don't provide a `MessageDeduplicationId` and the queue
|
674
|
+
# doesn't have `ContentBasedDeduplication` set, the action fails
|
675
|
+
# with an error.
|
676
|
+
#
|
677
|
+
# * If the queue has `ContentBasedDeduplication` set, your
|
678
|
+
# `MessageDeduplicationId` overrides the generated one.
|
679
|
+
#
|
680
|
+
# * When `ContentBasedDeduplication` is in effect, messages with
|
681
|
+
# identical content sent within the deduplication interval are
|
682
|
+
# treated as duplicates and only one copy of the message is
|
683
|
+
# delivered.
|
684
|
+
#
|
685
|
+
# * You can also use `ContentBasedDeduplication` for messages with
|
686
|
+
# identical content to be treated as duplicates.
|
687
|
+
#
|
688
|
+
# * If you send one message with `ContentBasedDeduplication` enabled
|
689
|
+
# and then another message with a `MessageDeduplicationId` that is
|
690
|
+
# the same as the one generated for the first
|
691
|
+
# `MessageDeduplicationId`, the two messages are treated as
|
692
|
+
# duplicates and only one copy of the message is delivered.
|
693
|
+
#
|
694
|
+
# Any other valid special request parameters (such as the following) are
|
695
|
+
# ignored:
|
696
|
+
#
|
697
|
+
# * `ApproximateNumberOfMessages`
|
698
|
+
#
|
699
|
+
# * `ApproximateNumberOfMessagesDelayed`
|
700
|
+
#
|
701
|
+
# * `ApproximateNumberOfMessagesNotVisible`
|
702
|
+
#
|
703
|
+
# * `CreatedTimestamp`
|
704
|
+
#
|
705
|
+
# * `LastModifiedTimestamp`
|
706
|
+
#
|
707
|
+
# * `QueueArn`
|
708
|
+
#
|
709
|
+
#
|
710
|
+
#
|
711
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html
|
712
|
+
# [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
|
713
|
+
# [3]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
|
714
|
+
# [4]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
|
715
|
+
# [5]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
|
716
|
+
# @return [EmptyStructure]
|
717
|
+
def set_attributes(options = {})
|
718
|
+
options = options.merge(queue_url: @url)
|
719
|
+
resp = @client.set_queue_attributes(options)
|
720
|
+
resp.data
|
721
|
+
end
|
667
722
|
|
668
|
-
|
723
|
+
# @!group Associations
|
669
724
|
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
end
|
686
|
-
y.yield(batch)
|
725
|
+
# @example Request syntax with placeholder values
|
726
|
+
#
|
727
|
+
# queue.dead_letter_source_queues()
|
728
|
+
# @param [Hash] options ({})
|
729
|
+
# @return [Queue::Collection]
|
730
|
+
def dead_letter_source_queues(options = {})
|
731
|
+
batches = Enumerator.new do |y|
|
732
|
+
batch = []
|
733
|
+
options = options.merge(queue_url: @url)
|
734
|
+
resp = @client.list_dead_letter_source_queues(options)
|
735
|
+
resp.data.queue_urls.each do |q|
|
736
|
+
batch << Queue.new(
|
737
|
+
url: q,
|
738
|
+
client: @client
|
739
|
+
)
|
687
740
|
end
|
688
|
-
|
741
|
+
y.yield(batch)
|
689
742
|
end
|
743
|
+
Queue::Collection.new(batches)
|
744
|
+
end
|
690
745
|
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
746
|
+
# @param [String] receipt_handle
|
747
|
+
# @return [Message]
|
748
|
+
def message(receipt_handle)
|
749
|
+
Message.new(
|
750
|
+
queue_url: @url,
|
751
|
+
receipt_handle: receipt_handle,
|
752
|
+
client: @client
|
753
|
+
)
|
754
|
+
end
|
700
755
|
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
756
|
+
# @deprecated
|
757
|
+
# @api private
|
758
|
+
def identifiers
|
759
|
+
{ url: @url }
|
760
|
+
end
|
761
|
+
deprecated(:identifiers)
|
707
762
|
|
708
|
-
|
763
|
+
private
|
709
764
|
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
end
|
765
|
+
def extract_url(args, options)
|
766
|
+
value = args[0] || options.delete(:url)
|
767
|
+
case value
|
768
|
+
when String then value
|
769
|
+
when nil then raise ArgumentError, "missing required option :url"
|
770
|
+
else
|
771
|
+
msg = "expected :url to be a String, got #{value.class}"
|
772
|
+
raise ArgumentError, msg
|
719
773
|
end
|
720
|
-
|
721
|
-
class Collection < Aws::Resources::Collection; end
|
722
774
|
end
|
775
|
+
|
776
|
+
class Collection < Aws::Resources::Collection; end
|
723
777
|
end
|
724
778
|
end
|