Test Fan-Out and message filtering

Test Fan-Out and message filtering

In this step, we will verify that the Amazon SNS Topic is publishing all messages to all subscribers. Since a subscriber might also fail to process a message, we also want to confirm that Amazon SNS is retrying message delivery so that we don’t miss a single message.

  1. Check the API Gateway endpoint
aws cloudformation describe-stacks \
    --stack-name wild-rydes-async-msg-1 \
    --query 'Stacks[].Outputs[?OutputKey==`UnicornManagementServiceApiSubmitRideCompletionEndpoint`].OutputValue' \
    --output text

Working with SNS

  1. Store the API Gateway endpoint URL.
export ENDPOINT=$(aws cloudformation describe-stacks \
    --stack-name wild-rydes-async-msg-1 \
    --query 'Stacks[].Outputs[?OutputKey==`UnicornManagementServiceApiSubmitRideCompletionEndpoint`].OutputValue' \
    --output text)
  • Send a few requests to the Unicorn Management Service:
curl -XPOST -i -H "Content-Type:application/json" -d '{ "from": "Berlin", "to": "Frankfurt", "duration": 420, "distance": 600, "customer": "cmr", "fare": 256.50 }' $ENDPOINT

Working with SNS

  1. Go to CloudWatch
  • Select Log Management
  • Select /aws/lambda/wild-rydes-async-msg-1-

Working with SNS

  1. In the log group interface:
  • Select Log streams
  • Select the created log stream.

Working with SNS

  1. Observe the detailed log events.

Working with SNS