Skip to Content

DVA-C02: How to Troubleshoot AWS Lambda Function Not Processing Orders

Learn how to debug and fix an issue where an AWS Lambda function behind Amazon API Gateway does not process orders during checkout. Understand the possible causes and solutions for this problem.

Table of Contents

Question

An ecommerce company is using an AWS Lambda function behind Amazon API Gateway as its application tier. To process orders during checkout, the application calls a POST API from the frontend. The POST API invokes the Lambda function asynchronously. In rare situations, the application has not processed orders.

The Lambda application logs show no errors or failures.

What should a developer do to solve this problem?

A. Inspect the frontend logs for API failures. Call the POST API manually by using the requests from the log file.
B. Create and inspect the Lambda dead-letter queue. Troubleshoot the failed functions. Reprocess the events.
C. Inspect the Lambda logs in Amazon CloudWatch for possible errors. Fix the errors.
D. Make sure that caching is disabled for the POST API in API Gateway.

Answer

B. Create and inspect the Lambda dead-letter queue. Troubleshoot the failed functions. Reprocess the events.

Explanation

The correct answer is B. Create and inspect the Lambda dead-letter queue. Troubleshoot the failed functions. Reprocess the events.

This solution will solve the problem because it will allow the developer to identify and handle the events that failed to be processed by the Lambda function. A dead-letter queue is a queue that stores messages that could not be successfully processed by a Lambda function. The developer can configure the Lambda function to send events to an Amazon SQS queue or an Amazon SNS topic as a dead-letter queue. The developer can then inspect the messages in the dead-letter queue, troubleshoot the root cause of the failures, and reprocess the events as needed.

The other options are not optimal because:

  • Option A: Inspecting the frontend logs for API failures and calling the POST API manually by using the requests from the log file will not solve the problem, as the issue is not with the API Gateway or the frontend, but with the Lambda function. The application calls the POST API asynchronously, which means that API Gateway returns a response immediately after sending an event to Lambda, without waiting for a response from Lambda. Therefore, the frontend logs will not show any API failures, even if the Lambda function fails to process some events.
  • Option C: Inspecting the Lambda logs in Amazon CloudWatch for possible errors and fixing them will not solve the problem, as the Lambda application logs show no errors or failures. This means that either the Lambda function did not receive some events from API Gateway, or it did receive them but failed to process them without logging any errors. In either case, inspecting the Lambda logs will not help identify and handle the unprocessed events.
  • Option D: Making sure that caching is disabled for the POST API in API Gateway will not solve the problem, as caching is not relevant for this scenario. Caching is used to improve performance and reduce latency by storing responses from a backend integration and returning them for subsequent requests that have the same cache key. However, caching is only applicable for GET methods, not for POST methods. Moreover, caching does not affect how API Gateway sends events to Lambda or how Lambda processes them.

Therefore, option B is the best solution for solving this problem.

The latest AWS Certified Developer – Associate DVA-C02 certification actual real practice exam question and answer (Q&A) dumps are available free, which are helpful for you to pass the AWS Certified Developer – Associate DVA-C02 exam and earn AWS Certified Developer – Associate DVA-C02 certification.

AWS Certified Developer - Associate DVA-C02 Exam Questions and Answers