Amazon::SQS::Simple::Queue - OO API for representing queues from the Amazon Simple Queue Service.
use Amazon::SQS::Simple;
my $access_key = 'foo'; # Your AWS Access Key ID
my $secret_key = 'bar'; # Your AWS Secret Key
my $sqs = new Amazon::SQS::Simple($access_key, $secret_key);
my $q = $sqs->CreateQueue('queue_name');
$q->SendMessage('Hello world!');
my $msg = $q->ReceiveMessage();
print $msg->MessageBody() # Hello world!
$q->DeleteMessage($msg->MessageId());
Don't instantiate this class directly. Objects of this class are returned
by various methods in Amazon::SQS::Simple. See the Amazon::SQS::Simple manpage for
more details.
Get the endpoint for the queue.
Deletes the queue. If $force is true, deletes the queue even if it
still contains messages.
Sends the message. The message can be up to 256KB in size and should be plain text.
Get the next message from the queue.
Returns an Amazon::SQS::Simple::Message object. See
the Amazon::SQS::Simple::Message manpage for more details.
Options for ReceiveMessage:
Number of messages to return
Delete the message with the specified message ID from the queue
Fetch the message with the specified message ID. Unlike ReceiveMessage
this doesn't affect the visibility of the message.
Returns an Amazon::SQS::Simple::Message object. See
the Amazon::SQS::Simple::Message manpage for more details.
Sets the timeout visibility of the message with the specified message ID to the specified timeout, in seconds.
Note that the timeout counts from the time the method is called. So if retrieved a message 30 seconds ago that had a timeout of 600 seconds, and call ChangeMessageVisility with a new timeout of 300s, the visibility will timeout in 300s.
Get the attributes for the queue. Returns a reference to a hash mapping attribute names to their values. Currently the following attribute names are returned:
Sets the value for a queue attribute. Currently the only valid
attribute name is VisibilityTimeout.
Adds the user identified by $identifier to the list of grantees for the list,
with the permissions specified by $permission.
$identifier should be an email address of a person with an Amazon Web Services
account. Alternatively, use a user ID in the format returned by ListGrants and add
IdentifierType = 'ID'> to %opts.
$permission must be one of ReceiveMessage, SendMessage or FullControl.
Revokes the permissions specified by $permission from the user identified by
$identifier for the list.
$identifier should be an email address of a person with an Amazon Web Services
account. Alternatively, use a user ID in the format returned by ListGrants and add
IdentifierType = 'ID'> to %opts.
$permission must be one of ReceiveMessage, SendMessage or FullControl.
List the grantees for this queue. Returns a hashref mapping permission types to arrays of hashrefs identifying users.
Permission types will be one of RECEIVEMESSAGE, SENDMESSAGE or FULLCONTROL.
The hashrefs identifying users have the following keys:
A unique identifier for the user
The user's display name, as registered on Amazon.com. The display name for a user can change over time.
Copyright 2007 Simon Whitaker <swhitaker@cpan.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.