Search code examples
amazon-web-servicesamazon-sqs

SQS long polling and retention policy


I have two questions regarding SQS which I couldn't find answers to.

  1. Seems like polling in the AWS console is always Long Polling, although the queue is set to short polling. It always polls for 30 seconds even when the Receive message wait time is set to 0. Is this possible or I didn't get it?
  2. When I have a DLQ connected to the standard queue and the retention period of the queue is over, will the message get to the DLQ or just disappear? When trying it, seems like the message disappears but I want to be sure that's the expected behavior.

Solution

  • Console polling

    It would appear that the Amazon SQS management console uses long polling when looking for messages, but it might be doing something quite different. It's hard to know how it was programmed.

    When a program calls the ReceiveMessage() API, it can specify WaitTimeSeconds to override the default setting on the queue.

    Retention Period

    From Basic Amazon SQS architecture - Amazon Simple Queue Service:

    Amazon SQS automatically deletes messages that have been in a queue for more than maximum message retention period.