mardi 21 avril 2015

Amazon SQS - Poll All Entries

I am planning on creating a delayed queue system for SQS (one that can delay jobs past the AWS limitations).

Essentially how this would work, is a single worker constantly polls the delayed queue, and compares the message->timestamp to the current unix timestamp.

If the current timestamp exceeds the message timestamp (aka the job should be ran now), then the polling worker should move that delayed message and assign it to a do_now queue, and delete it from the delayed_queue.

Else, it should just interpret the next entry in the delayed_queue. It should keep doing this, and then wrap around to continue the process infinitely.

Question Is: Does SQS behave like this natively? Assuming the jobs are not ready to run...If I poll the queue once, it will return the first job. If I poll it again, will it return the second (last) job? Finally, if I poll it once more, would it return the first job again (since there are no more entries to process)?




Aucun commentaire:

Enregistrer un commentaire