What does visibility Timeout mean for AWS SQS

Eastern Monk picture Eastern Monk · Feb 25, 2015 · Viewed 11.3k times · Source

What is the meaning of "Visibility Timeout" for Amazon SQS service ? What factors determine an ideal value for this field ?

I have looked at http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/Welcome.html

Answer

Rohit picture Rohit · Feb 25, 2015

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.