Effectively monitor new SQS messages

I use Amazon SQS in my application to receive messages. My application is used for image processing. I’m looking for an effective way to keep track of new posts. My first approach was to read the messages when the image finished processing.

The problem is that if one message arrives after polling for a maximum of 20 seconds, nothing will call the message reading function.

I was thinking of creating a function that runs at intervals, however I'm not sure which approach to take and if there are more efficient ways (quick search, fewer calls for empty results) to get closer to this.

I am using AWS SDK for .NET / C #

+4
source share
1 answer

AWS Long Polling documentation can be found here:

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

In addition, you can use either the Windows task scheduler that you plan to start (no more than 1 minute later), or if you need to process queue items faster, then the Windows service can start constantly by polling the queue at any frequency you want and then either do the work or “sleep” until you want to check again.

+2
source

Source: https://habr.com/ru/post/1528768/


All Articles