Closed whyvez closed 3 years ago
Since messages have a visibility timeout after being received they still remain in the queue but are not delivered, when using receiveMessage
.
So no - it is wrong to assume for the queue to be empty just because you don't retrieve a message currently. getQueueAttributes
should give you insights of the selected queue including the total message count.
Is it safe to assume that if no message is returned from
receiveMessage
that the queue is empty?I am using the following logic:
In my case, the process exits prematurely before the queue is empty, how could this happen?