Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does viewing an SQS message in console increase receive count?

I am new to AWS. I have a dead-letter SQS with 5 messages and I inspected the messages a few times while I was trying to figure out how they landed in the dead-letter queue. I am using AWS console to inspect the messages: right click the SQS, then select "View/Delete Messages" and click "Start polling for messages". And every time I inspect I see a higher ReceiveCount for all 5 messages, typically incremented by 1. What I don't understand is whether that means some other component is reading messages from the SQS or whether my act of very inspecting itself is causing the ReceiveCount to increment. So my question is, is the latter even a possibility? Can viewing the message from console result in incrementing the ReceiveCount?

like image 441
bappak Avatar asked Mar 21 '20 01:03

bappak


1 Answers

Yes. It is similar to NumberOfMessagesReceived CloudWatch metric:

The number of messages returned by calls to the ReceiveMessage action.

So each time you execute View/Delete Messages the messages are considered as received and no other consumer can view them until their visibility timeout finishes. Also you using View/Delete Messages contributes to general retry count a message in the queue. So if you have DLQ with default of 2 retries, and you view the messages twice, they will end up in the DLQ.

like image 115
Marcin Avatar answered Sep 28 '22 05:09

Marcin