The developer team has created a distributed application using Amazon SQS which buffers messages.
Currently, the team faces issues when the downstream component cannot process the SQS messages in time.
To resolve this issue, the Developer Team wants messages in the Amazon SQS queue to wait a period of time before being processed by the downstream.
Which of the following can be used for this purpose?
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer - C.
Delay Queue will add delay to the message when it's added to the queue.
In the above case, the Application needs additional time to process backend activities before processing new messages.
This can be done by increasing the time period of the delay queue.
Default Delay is 0 sec which is the minimum value, while the maximum delay can be set is 900 sec.
Options A & D are incorrect as visibility timeouts will be required to be set to hide the message once the subscriber consumes it.
In the above case, there should be a delay initially when a message is added to the queue.
Option B is incorrect as decreasing delay timers will make messages available to subscribers quickly.
For more information on delay queues with Amazon SQS, refer to the following URL-
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-delay-queues.htmlTo resolve the issue of downstream components being unable to process messages in time, the developer team can introduce a delay before the messages are processed. This can be achieved by using a delay queue in Amazon SQS.
A delay queue is a type of queue that holds messages for a specified amount of time before making them available for processing. Messages are not visible to consumers until the delay period has expired. When the delay period expires, the messages become visible to consumers and can be processed.
Therefore, the correct answer is C: Increase time period using delay queue.
Option A: Decreasing the time period using visibility timeouts is not an appropriate solution as it would decrease the time a message is hidden from other consumers once it has been picked up by a consumer, which is not relevant to the problem.
Option B: Decreasing the time period using a delay queue would make the messages available for processing sooner, which is opposite to what the developer team wants.
Option D: Increasing the time period using visibility timeouts is not an appropriate solution as it would increase the time a message is hidden from other consumers once it has been picked up by a consumer, which is not relevant to the problem.
Therefore, the correct answer is C: Increase time period using delay queue.