Reputation: 301
There is a SQS Queue in which I am getting messages continuously. I need to read and process only those messages that came in the last 24 hours. The messages which would be coming in currently should be processed on the next day. Timestamp
is stored in the body of the message.
Is it possible to read messages selectively from the SQS queue. For instance, read only those messages whose timestamp
value is greater than the previous day's timestamp but less than the current timestamp (current timestamp is the time at which this job is running)?
Upvotes: 3
Views: 1975
Reputation: 270069
The Amazon SQS ReceiveMessages
command returns a message (or a batch of messages) from the queue. The messages are in approximately FIFO (first in-first out) order but this is not guaranteed.
There is no way to selectively retrieve messages. It is not possible to use the contents of a message, a message attribute nor message metadata to limit the messages returned. It's basically popping a message off a stack.
Upvotes: 11