AWS - SNS and SQSYou want to process messages from multiple SQS queues subscribed to the same SNS topic in a single Lambda function. What is the best approach?ASubscribe the Lambda function directly to the SNS topic and remove SQS queues.BPublish messages directly to Lambda instead of SNS.CConfigure each SQS queue as an event source for the Lambda function.DUse SNS to send messages only to one SQS queue connected to Lambda.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand Lambda event sourcesLambda can poll multiple SQS queues as event sources.Step 2: Keep SNS and SQS for fan-outSNS fan-out sends messages to multiple queues; Lambda processes from queues.Final Answer:Configure each SQS queue as an event source for the Lambda function. -> Option CQuick Check:Lambda polls multiple SQS queues [OK]Quick Trick: Attach all SQS queues as Lambda event sources [OK]Common Mistakes:MISTAKESRemoving SQS queues and subscribing Lambda directlyPublishing messages directly to LambdaUsing only one queue for all messages
Master "SNS and SQS" in AWS9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More AWS Quizzes API Gateway - REST API creation - Quiz 2easy API Gateway - CORS configuration - Quiz 12easy API Gateway - API keys and usage plans - Quiz 6medium AWS Lambda - Environment variables in Lambda - Quiz 4medium CloudWatch - CloudWatch Logs - Quiz 1easy Elastic Load Balancing - Why load balancing matters - Quiz 10hard Elastic Load Balancing - Cross-zone load balancing - Quiz 7medium RDS and Relational Databases - RDS pricing considerations - Quiz 5medium RDS and Relational Databases - Parameter groups and option groups - Quiz 2easy RDS and Relational Databases - Read replicas for performance - Quiz 4medium