DVA-C02 exam dumps

DVA-C02 practice question 43 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 43

Select 3

You are developing a serverless application that processes data from an Amazon SQS queue using an AWS Lambda function. The function must process messages in batches of 10 and should automatically retry in case of failures. Which of the following configurations are required for the event source mapping to meet these requirements?

  1. A

    Set the BatchSize parameter to 10 in the event source mapping configuration.

  2. B

    Enable the ReportBatchItemFailures parameter in the event source mapping configuration.

  3. C

    Set the MaximumRetryAttempts parameter to 0 in the event source mapping configuration.

  4. D

    Configure the event source mapping's FilterCriteria to only process certain messages.

  5. E

    Set the VisibilityTimeout of the SQS queue to at least 6 times the Lambda function timeout.

Show answer and explanation

Correct answers: A, B, E

Explanation

To process messages in batches of 10, you must set the BatchSize parameter to 10. Enabling the ReportBatchItemFailures parameter allows the Lambda function to report individual message failures, ensuring retries for unprocessed messages. Additionally, the VisibilityTimeout of the SQS queue must be configured appropriately to allow retries without conflicting with the Lambda function's execution time. MaximumRetryAttempts and FilterCriteria are not required to meet the specific requirements of this scenario.

  • A. Correct.

    Correct. The BatchSize parameter determines the maximum number of records that the Lambda function processes in a single batch. Setting it to 10 ensures the function processes messages in batches of 10.

  • B. Correct.

    Correct. The ReportBatchItemFailures parameter enables the Lambda function to report individual message failures back to the SQS queue, allowing unprocessed messages to be retried.

  • C. Incorrect.

    Incorrect. Setting MaximumRetryAttempts to 0 disables retries. To ensure automatic retries, the default retry behavior or a custom retry configuration should be used.

  • D. Incorrect.

    Incorrect. FilterCriteria is used to filter messages based on specific attributes but is not required to meet the batch size or retry requirements in this scenario.

  • E. Correct.

    Correct. Setting the VisibilityTimeout of the SQS queue to at least 6 times the Lambda function timeout ensures that failed messages are not visible to other consumers before the function has sufficient time to process and retry.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam