Verify SQS Queues & Test Non-Matching Filter

After publishing the VIP order event to SNS, in this section you will verify delivery across both SQS queues and inspect the message payload and attributes in VIPExpressQueue. Next, you will perform a negative test with quantity = 4 to confirm that SNS strictly suppresses delivery for non-matching events, before cleaning up the queues to prepare for the next exercise.


Verify Dual-Queue Delivery in Amazon SQS

  1. Open the Amazon SQS console → Navigate to Queues.
  2. Click the refresh button. Observe the Messages available column for both queues:
    • BaristaQueue: Received the message (unfiltered, receives all orders).
    • VIPExpressQueue: Incremented to 1 message available!

Queues List Showing Messages in Both Queues


Poll and Inspect the VIP Express Message

  1. Click on the VIPExpressQueue queue → Click Send and receive messages.

VIPExpressQueue Details Page

VIPExpressQueue Details Page

  1. Scroll down and click the Poll for messages button.

  2. Click on the message ID to open the message details dialog:

Poll Messages in VIPExpressQueue

  • Body tab: Contains the full order receipt payload for 5x Espresso Doppio generated by Lambda.
  • Attributes tab:
    • quantity: 5 (Numeric match >= 5 satisfied).
    • is_vip: true

Inspect VIP Message Body

Inspect VIP Message Attributes


Negative Test: Test Non-Matching Quantity (Qty = 4)

To confirm that the filter policy strictly and accurately enforces the rule:

  1. Return to The Cozy Brew website and decrease Quantity to 4 (just below the threshold of 5).
  2. Click Place Order & Publish Event.

Test Non-Matching Quantity

  1. Return to the SQS Console and inspect the queues:
    • BaristaQueue receives 1 additional new order message.
    • VIPExpressQueue message count does NOT change — this message was blocked and completely discarded by Amazon SNS!

Inspect SQS Queues After Negative Test

  1. Purge or delete messages in both queues so they are clean and ready for the next exercise.

Purge SQS Queues

Purge SQS Queues

Purge SQS Queues

Purge SQS Queues

Purge SQS Queues

Purge SQS Queues


Summary of Chapter 4

You have successfully applied Amazon SNS Message Filtering:

  • Filter policies evaluate message attributes automatically at the infrastructure layer before message delivery.
  • High-volume, prioritized orders are automatically routed to a dedicated processing queue without complex routing logic in your application code.