Inspect Filter Policy & Place VIP Order

In this section, you will directly observe the JSON syntax of the numeric comparison filter policy (Numeric Filter Policy) configured on Amazon SNS for the VIPExpressQueue queue. Next, you will act as a customer placing a high-volume bulk order (quantity >= 5) on The Cozy Brew web interface to activate this filter policy.


Inspect the Pre-Configured VIP Filter Policy in Amazon SNS

In our CloudFormation template, a numeric comparison filter policy was attached to the VIPExpressQueue subscription. Let’s inspect it in the console:

  1. Navigate to the Amazon SNS Console → Select Subscriptions in the left navigation menu.
  2. In the Subscriptions list, click on the Subscription ID corresponding to the destination endpoint VIPExpressQueue.

SNS Subscriptions Table

  1. Scroll down to the Subscription filter policy section. Click the Edit button to observe the policy’s JSON structure:
{
  "quantity": [
    {
      "numeric": [ ">=", 5 ]
    }
  ]
}

Inspect Filter Policy JSON

Numeric Matching in SNS:
Amazon SNS supports numeric comparison operators including =, >, >=, <, <=, and range conditions [ “between”, min, max ]. In the example above, any message carrying a quantity attribute whose value is greater than or equal to 5 will satisfy the condition and be forwarded.


Place a High-Volume VIP Order (Qty >= 5)

Now let’s place a high-volume order from The Cozy Brew web interface to activate this filter:

  1. Open The Cozy Brew website in your browser.
  2. Select Espresso Doppio (or your favorite beverage).
  3. Set Cup Size: L (475ml).
  4. Click the stepper to increase the count to Quantity: 5 (or higher).
  5. Notice that the alert banner will appear immediately:
    “SNS Filter Policy Activated (Qty >= 5): Bulk orders satisfy the quantity >= 5 condition and will be automatically routed by SNS directly to VIPExpressQueue!”

Set Quantity to 5 in Web App

  1. Enter customer name under Customer Name (e.g., Tech Office Catering) and click Place Order & Publish Event.

  2. Observe the visual feedback on the interface:

    • On the AWS Architecture Event Flow diagram, both the BaristaQueue and VIPExpressQueue queue branches light up concurrently.
    • The status notification confirms: Success! VIP Order (5 items) routed to BaristaQueue AND VIPExpressQueue.

Submit VIP Order

VIP Order Successfully Published