File Coverage

blib/lib/Paws/SQS/ReceiveMessage.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1              
2             package Paws::SQS::ReceiveMessage;
3 1     1   515 use Moose;
  1     1   4  
  1         11  
  1         608  
  1         4  
  1         10  
4             has AttributeNames => (is => 'ro', isa => 'ArrayRef[Str|Undef]');
5             has MaxNumberOfMessages => (is => 'ro', isa => 'Int');
6             has MessageAttributeNames => (is => 'ro', isa => 'ArrayRef[Str|Undef]');
7             has QueueUrl => (is => 'ro', isa => 'Str', required => 1);
8             has ReceiveRequestAttemptId => (is => 'ro', isa => 'Str');
9             has VisibilityTimeout => (is => 'ro', isa => 'Int');
10             has WaitTimeSeconds => (is => 'ro', isa => 'Int');
11              
12 1     1   8170 use MooseX::ClassAttribute;
  1     1   2  
  1         11  
  1         6700  
  1         2  
  1         8  
13              
14             class_has _api_call => (isa => 'Str', is => 'ro', default => 'ReceiveMessage');
15             class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::SQS::ReceiveMessageResult');
16             class_has _result_key => (isa => 'Str', is => 'ro', default => 'ReceiveMessageResult');
17             1;
18              
19             ### main pod documentation begin ###
20              
21             =head1 NAME
22              
23             Paws::SQS::ReceiveMessage - Arguments for method ReceiveMessage on Paws::SQS
24              
25             =head1 DESCRIPTION
26              
27             This class represents the parameters used for calling the method ReceiveMessage on the
28             Amazon Simple Queue Service service. Use the attributes of this class
29             as arguments to method ReceiveMessage.
30              
31             You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to ReceiveMessage.
32              
33             As an example:
34              
35             $service_obj->ReceiveMessage(Att1 => $value1, Att2 => $value2, ...);
36              
37             Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
38              
39             =head1 ATTRIBUTES
40              
41              
42             =head2 AttributeNames => ArrayRef[Str|Undef]
43              
44             A list of attributes that need to be returned along with each message.
45             These attributes include:
46              
47             =over
48              
49             =item *
50              
51             C<All> - Returns all values.
52              
53             =item *
54              
55             C<ApproximateFirstReceiveTimestamp> - Returns the time the message was
56             first received from the queue (epoch time in milliseconds).
57              
58             =item *
59              
60             C<ApproximateReceiveCount> - Returns the number of times a message has
61             been received from the queue but not deleted.
62              
63             =item *
64              
65             C<SenderId>
66              
67             =over
68              
69             =item *
70              
71             For an IAM user, returns the IAM user ID, for example
72             C<ABCDEFGHI1JKLMNOPQ23R>.
73              
74             =item *
75              
76             For an IAM role, returns the IAM role ID, for example
77             C<ABCDE1F2GH3I4JK5LMNOP:i-a123b456>.
78              
79             =back
80              
81             =item *
82              
83             C<SentTimestamp> - Returns the time the message was sent to the queue
84             (epoch time in milliseconds).
85              
86             =item *
87              
88             C<MessageDeduplicationId> - Returns the value provided by the sender
89             that calls the C< SendMessage > action.
90              
91             =item *
92              
93             C<MessageGroupId> - Returns the value provided by the sender that calls
94             the C< SendMessage > action. Messages with the same C<MessageGroupId>
95             are returned in sequence.
96              
97             =item *
98              
99             C<SequenceNumber> - Returns the value provided by Amazon SQS.
100              
101             =back
102              
103             Any other valid special request parameters (such as the following) are
104             ignored:
105              
106             =over
107              
108             =item *
109              
110             C<ApproximateNumberOfMessages>
111              
112             =item *
113              
114             C<ApproximateNumberOfMessagesDelayed>
115              
116             =item *
117              
118             C<ApproximateNumberOfMessagesNotVisible>
119              
120             =item *
121              
122             C<CreatedTimestamp>
123              
124             =item *
125              
126             C<ContentBasedDeduplication>
127              
128             =item *
129              
130             C<DelaySeconds>
131              
132             =item *
133              
134             C<FifoQueue>
135              
136             =item *
137              
138             C<LastModifiedTimestamp>
139              
140             =item *
141              
142             C<MaximumMessageSize>
143              
144             =item *
145              
146             C<MessageRetentionPeriod>
147              
148             =item *
149              
150             C<Policy>
151              
152             =item *
153              
154             C<QueueArn>,
155              
156             =item *
157              
158             C<ReceiveMessageWaitTimeSeconds>
159              
160             =item *
161              
162             C<RedrivePolicy>
163              
164             =item *
165              
166             C<VisibilityTimeout>
167              
168             =back
169              
170              
171              
172              
173             =head2 MaxNumberOfMessages => Int
174              
175             The maximum number of messages to return. Amazon SQS never returns more
176             messages than this value (however, fewer messages might be returned).
177             Valid values are 1 to 10. Default is 1.
178              
179              
180              
181             =head2 MessageAttributeNames => ArrayRef[Str|Undef]
182              
183             The name of the message attribute, where I<N> is the index.
184              
185             =over
186              
187             =item *
188              
189             The name can contain alphanumeric characters and the underscore (C<_>),
190             hyphen (C<->), and period (C<.>).
191              
192             =item *
193              
194             The name is case-sensitive and must be unique among all attribute names
195             for the message.
196              
197             =item *
198              
199             The name must not start with AWS-reserved prefixes such as C<AWS.> or
200             C<Amazon.> (or any casing variants).
201              
202             =item *
203              
204             The name must not start or end with a period (C<.>), and it should not
205             have periods in succession (C<..>).
206              
207             =item *
208              
209             The name can be up to 256 characters long.
210              
211             =back
212              
213             When using C<ReceiveMessage>, you can send a list of attribute names to
214             receive, or you can return all of the attributes by specifying C<All>
215             or C<.*> in your request. You can also use all message attributes
216             starting with a prefix, for example C<bar.*>.
217              
218              
219              
220             =head2 B<REQUIRED> QueueUrl => Str
221              
222             The URL of the Amazon SQS queue from which messages are received.
223              
224             Queue URLs are case-sensitive.
225              
226              
227              
228             =head2 ReceiveRequestAttemptId => Str
229              
230             This parameter applies only to FIFO (first-in-first-out) queues.
231              
232             The token used for deduplication of C<ReceiveMessage> calls. If a
233             networking issue occurs after a C<ReceiveMessage> action, and instead
234             of a response you receive a generic error, you can retry the same
235             action with an identical C<ReceiveRequestAttemptId> to retrieve the
236             same set of messages, even if their visibility timeout has not yet
237             expired.
238              
239             =over
240              
241             =item *
242              
243             You can use C<ReceiveRequestAttemptId> only for 5 minutes after a
244             C<ReceiveMessage> action.
245              
246             =item *
247              
248             When you set C<FifoQueue>, a caller of the C<ReceiveMessage> action can
249             provide a C<ReceiveRequestAttemptId> explicitly.
250              
251             =item *
252              
253             If a caller of the C<ReceiveMessage> action doesn't provide a
254             C<ReceiveRequestAttemptId>, Amazon SQS generates a
255             C<ReceiveRequestAttemptId>.
256              
257             =item *
258              
259             You can retry the C<ReceiveMessage> action with the same
260             C<ReceiveRequestAttemptId> if none of the messages have been modified
261             (deleted or had their visibility changes).
262              
263             =item *
264              
265             During a visibility timeout, subsequent calls with the same
266             C<ReceiveRequestAttemptId> return the same messages and receipt
267             handles. If a retry occurs within the deduplication interval, it resets
268             the visibility timeout. For more information, see Visibility Timeout in
269             the I<Amazon Simple Queue Service Developer Guide>.
270              
271             If a caller of the C<ReceiveMessage> action is still processing
272             messages when the visibility timeout expires and messages become
273             visible, another worker reading from the same queue can receive the
274             same messages and therefore process duplicates. Also, if a reader whose
275             message processing time is longer than the visibility timeout tries to
276             delete the processed messages, the action fails with an error.
277              
278             To mitigate this effect, ensure that your application observes a safe
279             threshold before the visibility timeout expires and extend the
280             visibility timeout as necessary.
281              
282             =item *
283              
284             While messages with a particular C<MessageGroupId> are invisible, no
285             more messages belonging to the same C<MessageGroupId> are returned
286             until the visibility timeout expires. You can still receive messages
287             with another C<MessageGroupId> as long as it is also visible.
288              
289             =item *
290              
291             If a caller of C<ReceiveMessage> can't track the
292             C<ReceiveRequestAttemptId>, no retries work until the original
293             visibility timeout expires. As a result, delays might occur but the
294             messages in the queue remain in a strict order.
295              
296             =back
297              
298             The length of C<ReceiveRequestAttemptId> is 128 characters.
299             C<ReceiveRequestAttemptId> can contain alphanumeric characters (C<a-z>,
300             C<A-Z>, C<0-9>) and punctuation
301             (C<!"#$%&'()*+,-./:;E<lt>=E<gt>?@[\]^_`{|}~>).
302              
303             For best practices of using C<ReceiveRequestAttemptId>, see Using the
304             ReceiveRequestAttemptId Request Parameter in the I<Amazon Simple Queue
305             Service Developer Guide>.
306              
307              
308              
309             =head2 VisibilityTimeout => Int
310              
311             The duration (in seconds) that the received messages are hidden from
312             subsequent retrieve requests after being retrieved by a
313             C<ReceiveMessage> request.
314              
315              
316              
317             =head2 WaitTimeSeconds => Int
318              
319             The duration (in seconds) for which the call waits for a message to
320             arrive in the queue before returning. If a message is available, the
321             call returns sooner than C<WaitTimeSeconds>. If no messages are
322             available and the wait time expires, the call returns successfully with
323             an empty list of messages.
324              
325              
326              
327              
328             =head1 SEE ALSO
329              
330             This class forms part of L<Paws>, documenting arguments for method ReceiveMessage in L<Paws::SQS>
331              
332             =head1 BUGS and CONTRIBUTIONS
333              
334             The source code is located here: https://github.com/pplu/aws-sdk-perl
335              
336             Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues
337              
338             =cut
339