Giter VIP home page Giter VIP logo

amazon-sqs-simple's People

Contributors

cebjyre avatar cjhamil avatar cjones586 avatar fleetfootmike avatar laenfinehack avatar rolandwalker avatar rustyconover avatar seales avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

amazon-sqs-simple's Issues

Intermittent failure where 'AWSAccessKeyId' => 'AWSAccessKeyId'

Is the bug from https://rt.cpan.org/Public/Bug/Display.html?id=95807 fixed here?


System: Ubuntu 14.04 trusty
Amazon::SQS::Simple from ubuntu package libamazon-sqs-simple-perl 2.03-1
(our $VERSION = '2.03';)

Using it to send messages only, it works fine most of the time but
sometime I get the error:

ERROR [try ]: On calling SendMessage: 403 Forbidden (The AWS Access Key
Id you provided does not exist in our records.)

If that's the case I notice that Amazon::SQS::Simple::Queue has wrong
AWSAccessKeyId, here's dump of the object:

$VAR1 = bless({
'SignatureVersion' => 2,
'SecretKey' => 'correct secret key is here',
'Version' => '2012-11-05',
'Endpoint' => 'http://queue.amazonaws.com/089741050239 ...',
'AWSAccessKeyId' => 'AWSAccessKeyId'
}, 'Amazon::SQS::Simple::Queue' );

AWSAccessKeyId is set to 'AWSAccessKeyId'. At first I thought I am doing
something wrong but it's a pretty simple script that gets both aws
access key and aws secret key from command line. I run it number of
times and most of the time it does work but sometime it doesn't (in
approximately 10% to 20% it does not work).

parse queue endpoint to understand ARN as well as URL.

This code causes a crash:

my $sqs = new Amazon::SQS::Simple( $access_key, $secret_key );
my $q = $sqs->GetQueue($endpoint);
my $msg = $q->ReceiveMessage();

Error msg:

Can't locate object method "host" via package "URI::_foreign" at /Users/jean/perl5/perlbrew/perls/perl-5.16.2_threads/lib/site_perl/5.16.2/Amazon/SQS/Simple/Base.pm line 227.

Retry Support

I would like an option for retry such as http://search.cpan.org/~pfig/Net-Amazon-S3-0.60/lib/Net/Amazon/S3.pm

I sometimes encounter 403 error.
Now I manually retry.

my $res;
my $sleep     = 1; # 1 second
my $retry_max = 10;
my $failed    = 0;

while (! $res ) {
    my $sqs = Amazon::SQS::Simple->new( $aws_access_key, $aws_secret_key );
    $sqs->{Endpoint} = "https://ap-northeast-1.queue.amazonaws.com";
    my $q = $sqs->CreateQueue($queue_name);
    my $message = "Hello!";
    eval { $res = $q->SendMessage($message) };
    if ($@) {
        sleep $sleep;
        $sleep *= 2; # exponential backoff
        $failed++;
        if ($failed == $retry_max) {
            last; # give up ...
        }
    }
}

Or please let me know the better way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.