AWS Certified Solutions Architect Professional SAP-C02 Practice Question
An e-commerce company is refactoring a legacy order-processing application into several microservices that run in separate AWS accounts. The monolith currently writes every order event to an Amazon SQS queue. A Lambda function examines each message's JSON payload and forwards it to three downstream SQS queues-one per microservice-based on the value of the eventType field (ORDER_CREATED, PAYMENT_CAPTURED, or ORDER_CANCELLED).
The development team wants to retire the Lambda router to reduce operational overhead, keep costs low, and continue using SQS for downstream processing. Exactly-once delivery and strict ordering are not required.
Which solution will meet these requirements with the least custom code?
Publish every order event to a single Amazon SNS standard topic. Create a dedicated Amazon SQS queue for each microservice and subscribe each queue to the topic. Attach a payload-based filter policy that matches only the required eventType values for that microservice.
Replace the Lambda router with an Amazon SNS FIFO topic. Set the eventType value as the message-group ID and subscribe each microservice's SQS queue to the topic so that only matching messages are delivered.
Configure an Amazon EventBridge custom event bus. Publish each order event to the bus and create one rule per eventType that routes matching events to the appropriate SQS queue.
Create three separate Amazon SNS topics, one for each eventType. Modify the order-processing service so that it publishes every event to all three topics, and have each microservice subscribe to its dedicated topic.
Publishing to a single Amazon SNS standard topic and attaching a filter policy to each subscription offloads all routing logic to the managed service. Each microservice still consumes from its own SQS queue, but it now receives only the event types that match its payload-based filter policy. This removes the custom Lambda router and scales automatically with no additional code or infrastructure.
EventBridge rules (second choice) could also filter messages, but it introduces another managed service and additional cost when SNS alone is sufficient. Creating three separate SNS topics (third choice) forces application changes and duplicates publishes, increasing complexity. Using an SNS FIFO topic with the eventType as the message-group ID (fourth choice) does not restrict delivery to particular subscribers-every subscribed queue still receives all messages unless a filter policy is added, so the router logic would remain necessary.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a payload-based filter policy in Amazon SNS?
Open an interactive chat with Bash
Why is using Amazon SNS standard topics with SQS queues preferable for this use case?
Open an interactive chat with Bash
How does Amazon EventBridge differ from Amazon SNS in this messaging use case?
Open an interactive chat with Bash
AWS Certified Solutions Architect Professional SAP-C02
Accelerate Workload Migration and Modernization
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access