Giter VIP home page Giter VIP logo

go-sqs-poller's Introduction

go-sqs-poller's People

Contributors

bernata avatar jwhitcraft avatar tillkuhn avatar vaihtovirta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

go-sqs-poller's Issues

WaitTimeSeconds not Waiting

I've downloaded and started using the latest release of this repo. A notable change, aside from the code itself, was noted.

Previous behavior: When starting, the poller would output worker: Start Polling once every 30 seconds
Current behavior: When starting, the poller would output worker: Start Polling once every second

I figured this might be controlled by the WaitTimeSecond property of &worker.Config. However, changing that value didn't really change anything. So I digged into your source code and found the following:

go-sqs-poller/worker.go inside the Start function exists the following block of code:

			params := &sqs.ReceiveMessageInput{
				QueueUrl:            aws.String(worker.Config.QueueURL), // Required
				MaxNumberOfMessages: aws.Int64(worker.Config.MaxNumberOfMessage),
				AttributeNames: []*string{
					aws.String("All"), // Required
				},
				WaitTimeSeconds: aws.Int64(worker.Config.MaxNumberOfMessage),
			}

If you notice the WaitTimeSeconds paramter, it's using worker.Config.MaxNumberOfMessage from the Config struct. I changed that manually into worker.Config.WaitTimeSecond and it started working as I expected.

I couldn't make sense of the whole thing because there are no comments regarding the struct itself.

Please let me know if I'm thinking correctly. If you wish, and I do make sense, I could open a Pull Request for it.

Thank you!

Can only run one of these in a given Go app

Because of the way QueueURL is defined, you can only run one of these polls in a given application/exectuable.

I've done some modifications in my fork - if these are acceptable to you, i can clean up the example and do a Pull Request.

add MessageAttributeNames to sqs.ReceiveMessageInput.

I want to process by checking the attribute included in each message.
Please review adding MessageAttributeNames to the worker.go Start method as shown below.

params := &sqs.ReceiveMessageInput{
    QueueUrl:            aws.String(worker.Config.QueueURL), // Required
    MaxNumberOfMessages: aws.Int64(worker.Config.MaxNumberOfMessage),
    AttributeNames: []*string{
        aws.String("All"), // Required
    },
    MessageAttributeNames: []*string{
        aws.String(sqs.QueueAttributeNameAll),
    },
    WaitTimeSeconds: aws.Int64(worker.Config.WaitTimeSecond),
}

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.