AWS ECS Fargate (us-west-1)
Load Testers (run manually via aws ecs run-task)
Product Service (3 instances)
AWS Supporting Services

Application Load Balancer

Path-based Routing + ATW Anomaly Mitigation

Path Target
/product* Product TG (ATW on)
/credit-card-authorizer/* CCA TG
/shopping-cart* (default) Cart TG

Load Tester: Checkout

MODE=checkout | Task: cs6650-load-tester

200,000 × POST /shopping-carts/{id}/checkout
100 threads | 1024 CPU / 2 GB RAM

Flow: pre-create 100 carts → timed 200k checkout calls
Reports: success / fail count, wall time, throughput
Purpose: measure system throughput + RabbitMQ queue stability

Load Tester: Product (ATW Demo)

MODE=product | Task: cs6650-load-tester-product

200,000 × POST /product
100 threads | 1024 CPU / 2 GB RAM

Flow: random SKU/manufacturer data → ALB → product-tg
Reports: success / fail count, wall time, throughput
Purpose: trigger ATW — bad instance flagged Anomalous ⚠️

Credit Card Authorizer

256 CPU / 512 MB | port 8082

Validation
Format: XXXX-XXXX-XXXX-XXXX

Decision

  • 90% → 200 Authorized
  • 10% → 402 Declined

POST /credit-card-authorizer/authorize

Called by Shopping Cart via ALB
(CCA_URL = ALB DNS)

product-good-1

256 CPU / 512 MB
BAD_INSTANCE=false
✅ 100% → 201

Shopping Cart Service

512 CPU / 1 GB RAM | port 8081

State (in-memory)

  • ConcurrentHashMap carts
  • AtomicInteger cart/order IDs

Endpoints

  • POST /shopping-cart
  • POST /shopping-carts/{id}/addItem
  • POST /shopping-carts/{id}/checkout

Channel Pool (size=20, min-idle=5)

ATW detects high 503 rate
→ flags as Anomalous
→ Mitigation: Yes
→ reduces traffic weight

RabbitMQ

512 CPU / 1 GB RAM
ports: 5672 (AMQP) / 15672 (UI)

Queue: order_queue

  • durable = true
  • persistent messages

Publisher Confirms
waitForConfirmsOrDie(5000ms)

Discovery: rabbitmq.cs6650.local

Warehouse Consumer

512 CPU / 1 GB RAM

10 threads, each with own Channel
prefetchCount = 10
autoAck = false (manual ACK)

On success: basicAck()
On error: basicNack(requeue=true)

State: ConcurrentHashMap productQuantities
Shutdown hook: prints total orders processed

AWS Cloud Map
Private DNS namespace
rabbitmq.cs6650.local

CloudWatch Logs
Log group: /ecs/cs6650
Retention: 7 days

Amazon ECR
5 repos under cs6650/
Built & pushed via push-ecr.sh

IAM
ECS task execution roles
ECR pull permissions

VPC & Security Groups — Default VPC, public subnets
ALB SG: 0.0.0.0/0 :80 | Services SG: ingress from ALB + internal

product-bad

256 CPU / 512 MB
BAD_INSTANCE=true
⚠️ 50% → 503 / 50% → 201

product-good-2

256 CPU / 512 MB
BAD_INSTANCE=false
✅ 100% → 201