exam questions

Exam AWS Certified Solutions Architect - Associate SAA-C02 All Questions

View all questions & answers for the AWS Certified Solutions Architect - Associate SAA-C02 exam

Exam AWS Certified Solutions Architect - Associate SAA-C02 topic 1 question 69 discussion

A company hosts an application on multiple Amazon EC2 instances. The application processes messages from an Amazon SQS queue, writes for an Amazon

RDS table, and deletes -
the message from the queue. Occasional duplicate records are found in the RDS table. The SQS queue does not contain any duplicate messages.
What should a solutions architect do to ensure messages are being processed once only?

  • A. Use the CreateQueue API call to create a new queue.
  • B. Use the AddPermission API call to add appropriate permissions.
  • C. Use the ReceiveMessage API call to set an appropriate wait time.
  • D. Use the ChangeMessageVisibility API call to increase the visibility timeout.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
akhi3012
Highly Voted 3 years, 8 months ago
D is correct
upvoted 43 times
aguy9
3 years, 7 months ago
Answer is D. Increasing visibility time out will allow more time for the message to be processed and deleted before it has a chance to become visible again to other subscribers to the SQS queue
upvoted 36 times
...
...
fabras
Highly Voted 3 years, 8 months ago
D - The visibility timeout begins when Amazon SQS returns a message. During this time, the consumer processes and deletes the message. However, if the consumer fails before deleting the message and your system doesn't call the DeleteMessage action for that message before the visibility timeout expires, the message becomes visible to other consumers and the message is received again. If a message must be received only once, your consumer should delete it within the duration of the visibility timeout. https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
upvoted 42 times
...
queen101
Most Recent 2 years, 10 months ago
Visibility needs to be increase. DDDDDDDDD
upvoted 1 times
...
marklovesaws143
2 years, 10 months ago
Selected Answer: D
DDDDDDDDDDDDDDDD
upvoted 1 times
...
slcheng
2 years, 11 months ago
Selected Answer: D
Agreed with D
upvoted 1 times
...
jj22222
3 years, 5 months ago
Selected Answer: D
DDDDDDDDDD - visibility time out,
upvoted 1 times
...
weilun_tann
3 years, 5 months ago
Selected Answer: D
D. Use the ChangeMessageVisibility API call to increase the visibility timeout. - The problem here is multiple EC2 instances are picking up the SAME message, processing them, and writing the results into RDS - This is caused by the visibility timeout being shorter than the processing time, resulting in timeout expiring BEFORE the EC2 instances can finish processing and DELETE the message from the queue A. Use the CreateQueue API call to create a new queue. The new queue will be subjected to the same problem B. Use the AddPermission API call to add appropriate permissions. Nothing to do with permissions C. Use the ReceiveMessage API call to set an appropriate wait time. Increasing this will change consumer polling method from short to long polling, which helps to ELIMINATE EMPTY RESPONSES
upvoted 9 times
...
[Removed]
3 years, 6 months ago
Option D is the most preferred!
upvoted 1 times
...
Vijay1986
3 years, 6 months ago
Selected Answer: D
D is the answer - increase ChangeVisibilityTimeout
upvoted 1 times
...
karthisena
3 years, 7 months ago
Explanation: Keyword: SQS queue writes to an Amazon RDS From this, Option D best suite & other Options ruled out [Option A - You can't intruduce one more Queue in the existing one; Option B - only Permission & Option C - Only Retrieves Messages] FIF O queues are designed to never introduce duplicate messages. However, your message producer might introduce duplicates in certain scenarios: for example, if the producer sends a message, does not receive a response, and then resends the same message. Amazon SQS APIs provide deduplication functionality that prevents your message producer from sending duplicates. Any duplicates introduced by the message producer are removed within a 5-minute deduplication interval. For standard queues, you might occasionally receive a duplicate copy of a message (at-least- once delivery). If you use a standard queue, you must design your applications to be idempotent (that is, they must not be affected adversely when processing the same message more than once).
upvoted 2 times
...
woke
3 years, 7 months ago
D is correct
upvoted 2 times
...
Pavan111
3 years, 7 months ago
Key thing to note: Your application processing time is more than the visibility timeout. So, increaseing message visibility timeout can help to prevent duplicate entries in RDS.
upvoted 1 times
...
Abdullah777
3 years, 7 months ago
D sure
upvoted 2 times
...
syu31svc
3 years, 7 months ago
Correct answer is D as the SQS hides the message from other consumers for the visibility timeout, if it expires and the message is not deleted, the message would be available for other consumers leading to duplicates. ChangeMessageVisibility API would provide consumers additional time to process message and delete it once processed.
upvoted 2 times
...
KK_uniq
3 years, 7 months ago
D for sure. Message visibility in Queue
upvoted 2 times
...
mryala
3 years, 7 months ago
it's D
upvoted 1 times
...
Ankitrathi85
3 years, 7 months ago
D right
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...