Subscribe Email & Inspect Subscriptions

Before publishing beverage order events from the web application, we need to prepare the consumer endpoints (subscribers). In this section, you will subscribe your personal email address to the CoffeeOrders topic on Amazon SNS, confirm subscription permissions, and inspect the pre-configured Amazon SQS queues along with the error message isolation. Dead-Letter Queue (DLQ) created by CloudFormation.


Subscribe Your Email to the CoffeeOrders Topic

  1. Sign in to the AWS Management Console and navigate to the Amazon SNS service (ensure the Region is Singapore ap-southeast-1).
  2. In the left navigation menu, select Topics and click on the CoffeeOrders topic.

SNS Topics List

Create SNS Subscription

  1. Under the Subscriptions tab, click the Create subscription button.

Enter Subscription Email Address

  1. Configure the subscription settings:
    • Protocol: Select Email.
    • Endpoint: Enter your personal or work email address.
    • Leave all other settings as default and click Create subscription.

Enter Subscription Email Address

You should use an active email address that you frequently check to easily track progress.

  1. The initial status of the subscription will display as Pending confirmation.

Subscription Pending Confirmation

Subscription Pending Confirmation

  1. Open your email inbox, find the email from AWS titled AWS Notification - Subscription Confirmation, and click the Confirm subscription link.

Confirm Subscription in Email

Confirm Subscription in Email

  • Click CONFIRM to receive the confirmation notification as shown below:

Subscription Confirmation Message

  1. A new browser tab will open displaying Subscription confirmed!. Return to the AWS SNS Console and refresh the page; the Status column will now turn green with the status Confirmed.

Subscription Confirmed


Verify Pre-Configured SQS Subscriptions & Dead-Letter Queue (DLQ)

  1. On the CoffeeOrders topic details page, observe the Subscriptions table:

Topic Subscriptions List

You will see three subscriber endpoints:

  • Email subscription: Receives confirmation notifications for every order published to the topic.
  • BaristaQueue: An unfiltered SQS queue subscription — receives all orders to serve the kitchen brewing station.
  • VIPExpressQueue: An SQS queue subscription with attribute filter policy: quantity >= 5.

Inspect BaristaQueue Subscription

Inspect BaristaQueue Subscription

  1. In the AWS Management Console search bar, type SQS and select Simple Queue Service → click on the BaristaQueue queue.
  2. Scroll down and click the Dead-letter queue tab:
    • Status: Enabled
    • Dead-letter queue: arn:aws:sqs:...:BaristaDLQ
    • Maximum receives: 3

Inspect BaristaQueue Dead-Letter Queue

Inspect BaristaQueue Dead-Letter Queue

Inspect BaristaQueue Dead-Letter Queue

Dead-Letter Queue (DLQ) Protection Mechanism:
If an order message is malformed (e.g., corrupt JSON format or invalid product code) causing the consumer worker process to crash, Amazon SQS will retry up to 3 times. If processing still fails, SQS automatically isolates this poison message into BaristaDLQ. As a result, all healthy orders behind it continue to be processed without blocking (preventing Head-of-Line Blocking)!