Amazon-SQS-Simple

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

		Added SendMessageBatch, ReceiveMessageBatch (Chris Jones)
		
2.01	1 Jul 2013
		Fix bug with SendMessageBatch and single messages :D
		
2.02	1 Jul 2013
		As above with updated Changes file :D
		
2.04	1 Sep 2013
		Retry 500 errors (on advice from AWS support)
		Handle ARN-style endpoints (https://sqs.<host>.amazonaws.com/<nnn>/<queue>)

2.05    16 Jan 2017
        Add v4 signature support (rustyconover)
        Better tracking of retries (cjhamil)
        Retry 503s as well (Chris Jones)
        
2.06    20 Mar 2017
        Fix 500/503 retry code so it actually works

2.07    18 Sep 2018

lib/Amazon/SQS/Simple.pm  view on Meta::CPAN


use Carp qw( croak );
use Amazon::SQS::Simple::Base; # for constants
use Amazon::SQS::Simple::Queue;
use base qw(Exporter Amazon::SQS::Simple::Base);

our $VERSION   = '2.07';
our @EXPORT_OK = qw( timestamp );

sub GetQueue {
    my ($self, $queue_endpoint) = @_;

	if ($queue_endpoint =~ /^arn:aws:sqs/) {
		my ($host, $user, $queue);
		(undef, undef, undef, $host, $user, $queue) = split(/:/, $queue_endpoint);
		$queue_endpoint = "https://sqs.$host.amazonaws.com/$user/$queue";
	}

    return Amazon::SQS::Simple::Queue->new(
        $self->{AWSAccessKeyId},	#AWSAccessKeyId and SecretKey are the first two arguments to Amazon::SQS::Simple::Base->new
        $self->{SecretKey},
        %$self,
        Endpoint => $queue_endpoint,
    );
}

sub CreateQueue {
    my ($self, $queue_name, %params) = @_;
    
    $params{Action}    = 'CreateQueue';
    $params{QueueName} = $queue_name;
        
    my $href = $self->_dispatch(\%params);

lib/Amazon/SQS/Simple.pm  view on Meta::CPAN

 my $sqs = new Amazon::SQS::Simple($access_key, $secret_key, Version => '2008-01-01');

=back

=back

=head1 METHODS

=over 2

=item GetQueue($queue_endpoint)

Gets the queue with the given endpoint. Returns a 
C<Amazon::SQS::Simple::Queue> object. (See L<Amazon::SQS::Simple::Queue> for details.)

=item CreateQueue($queue_name, [%opts])

Creates a new queue with the given name. Returns a 
C<Amazon::SQS::Simple::Queue> object. (See L<Amazon::SQS::Simple::Queue> for details.)

Options for CreateQueue:

=over 4

lib/Amazon/SQS/Simple/Queue.pm  view on Meta::CPAN

Don't instantiate this class directly. Objects of this class are returned
by various methods in C<Amazon::SQS::Simple>. See L<Amazon::SQS::Simple> for
more details.

=head1 METHODS

=over 2

=item B<Endpoint()>

Get the endpoint for the queue.

=item B<Delete([%opts])>
 
Deletes the queue. Any messages contained in the queue will be lost.

=item B<Purge>

Purges the queue.

=item B<SendMessage($message, [%opts])>



( run in 0.273 second using v1.01-cache-2.11-cpan-b61123c0432 )