
Answer-first summary for fast verification
Answer: Use ChangeMessageVisibility action to extend a message's visibility timeout
The correct solution to address the use-case where the video encoding process takes longer than usual, and to prevent the same raw footage from being processed by multiple consumers, is to use the ChangeMessageVisibility action to extend a message's visibility timeout. Amazon SQS employs a visibility timeout mechanism to ensure that once a message is received by a consumer, it is not accessible to other consumers until the processing is complete. By default, the visibility timeout for a message is set to 30 seconds, but it can be adjusted to a minimum of 0 seconds and a maximum of 12 hours. Extending the visibility timeout using the ChangeMessageVisibility action allows developers to manage the processing time for messages more effectively, especially in cases where tasks take longer than expected. This approach helps in avoiding duplicate processing and ensures that messages are only processed once, maintaining the integrity and efficiency of the application.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Consider an application hosted on an EC2 instance that processes raw footage files. Typically, the encoding process for each file takes about 20 seconds. This application retrieves job messages from an SQS queue to start processing the files. What strategy would you recommend to manage situations where the encoding process takes longer than expected, ensuring that the same raw footage file is not processed simultaneously by multiple consumers?
A
Use WaitTimeSeconds action to short poll and extend a message's visibility timeout
B
Use DelaySeconds action to delay a message's visibility timeout
C
Use WaitTimeSeconds action to long poll and extend a message's visibility timeout
D
Use ChangeMessageVisibility action to extend a message's visibility timeout
No comments yet.