exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

View all questions & answers for the AWS Certified Developer - Associate DVA-C02 exam

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 530 discussion

A developer has an application container, an AWS Lambda function, and an Amazon Simple Queue Service (Amazon SQS) queue. The Lambda function uses the SQS queue as an event source. The Lambda function makes a call to a third-party machine learning API when the function is invoked. The response from the third-party API can take up to 60 seconds to return.

The Lambda function's timeout value is currently 65 seconds. The developer has noticed that the Lambda function sometimes processes duplicate messages from the SQS queue.

What should the developer do to ensure that the Lambda function does not process duplicate messages?

  • A. Configure the Lambda function with a larger amount of memory.
  • B. Configure an increase in the Lambda function’s timeout value.
  • C. Configure the SQS queue’s delivery delay value to be greater than the maximum time it takes to call the third-party API.
  • D. Configure the SQS queue’s visibility timeout value to be greater than the maximum time it takes to call the third-party API.
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
vbloise
1 month, 4 weeks ago
Selected Answer: D
The correct answer is: D. Configure the SQS queue’s visibility timeout value to be greater than the maximum time it takes to call the third-party API. Explanation: When a Lambda function reads a message from an SQS queue, the message becomes invisible for the duration of the visibility timeout. If the Lambda function doesn’t finish processing (or doesn’t delete the message from the queue) before the visibility timeout expires, the message becomes visible again and may be reprocessed, causing duplicates. Since the third-party API can take up to 60 seconds, the visibility timeout should be set to greater than 60 seconds to ensure that the message remains hidden from other consumers until the Lambda function finishes processing it.
upvoted 1 times
...
italiancloud2025
4 months, 1 week ago
Selected Answer: D
el tiempo de visibilidad del mensaje en la cola SQS es demasiado corto
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 ...