What does visibility Timeout mean for AWS SQS

When using sqs as queuing service, when you read the message off the queue it does not automatically delete the message off the queue. So when you are processing the message, sqs will wait for the time period defined as visibility timeout before other consumers will get the same message again.

The best time value to set for the visibility timeout will be at least the timeout value for the consumer process. If the consumer is able to successfully complete the processing then it would delete the message off the queue else if it times out then the message reappears in the queue for other consumer to pick it again.


Visibility timeout is the time-period or duration you specify for the queue item which when is fetched and processed by the consumer is made hidden from the queue and other consumers.

The main purpose is to avoid multiple consumers (or the same consumer), consuming the same item repetitively.

The key factor to be considered while arriving at this value is the time & effort taken by the consumer(s) to process a single queue item.