Question

I am using Amazon SQS in my app to consume messages. My app is used to process images. I am searching for an efficient way to continuously monitor for new messages. My first approach was to read the messages when an image finished processing.

The problem is that if one message arrived after the max 20 seconds long polling, nothing will trigger the read message function.

I thought about creating a function that runs at an interval, however I am not sure which approach to take and whether there are more efficient ways (fast retrieval, less calls for empty results) to approach this.

I am using AWS SDK for .NET / C#

Was it helpful?

Solution

AWS Long Polling documentation can be found here:

http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html

Also, you can use either a windows task scheduler that is scheduled to run (at most every 1 minute), or if you need to process queue items faster than that, a windows service can run constantly, polling th queue with whatever frequency you want, and then either doing the work, or 'sleeping' until you want to check again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top