Question

Difficulty: EasyMessage-Based Integration using Amazon SQS and SNS

An application publishes transaction events to an Amazon SNS topic. A fraud detection service is subscribed to this topic and must only process transactions where the amount is greater than $10,000. Other subscribers must continue to receive all transaction events. Which configuration should the developer implement to meet this requirement?

  1. Define a subscription filter policy on the Amazon SNS subscription for the fraud detection service to match the transaction amount attribute.Answer
  2. B
    Decrease the Amazon SQS visibility timeout of the queue subscribed to the topic to zero so that the fraud detection service can quickly skip unwanted messages.
  3. C
    Initialize the AWS SDK client with hardcoded credentials in the fraud detection application to dynamically create new temporary SQS queues for filtering.
  4. D
    Configure the AWS Lambda function consuming the messages to use a short timeout limit so that executions handling transactions under $10,000 terminate early.

Answer

Define a subscription filter policy on the Amazon SNS subscription for the fraud detection service to match the transaction amount attribute.
Defining a subscription filter policy on the Amazon SNS subscription is the standard, native method to filter messages. When a message is published to the topic with matching attributes, SNS automatically filters it so that only the interested subscription receives it, while other subscriptions are unaffected.

Step-by-Step Solution

1
Identify the requirement to send a subset of messages from an Amazon SNS topic to a specific subscriber without affecting other subscribers.
The requirement calls for selective message delivery (filtering) at the subscription level.
This allows different subscribers to consume only the messages they need.
2
Evaluate the native filtering capabilities of Amazon SNS.
Amazon SNS supports Subscription Filter Policies, which evaluate message attributes to determine if a message should be delivered to that subscription.
This offloads filtering logic from the application code to the managed service.

Key Concept

Amazon SNS Subscription Filter Policies allow subscribers to filter messages based on message attributes so that they only receive messages of interest.
Rate this question