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
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
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.
Basically the time taken by the consumer to process the message. And during the same time the message is unvailable for any other consumer (since this is a distributed system). Although the time priod is configurable, the default visibility timeout for a message is 30 seconds. The minimum is 0 seconds. The maximum is 12 hours.
Visibility Timeout is an important functionality of Amazon SQS. It helps to ensure the integrity and reliability of message processing in distributed systems.
You can know more about it here https://link.medium.com/u3A8aId0Swb
© 2022 - 2024 — McMap. All rights reserved.