Skip to content
Weave templates

Message Queue Fan-Out

One publisher, an SNS topic and four filtered SQS subscriptions — plus a separate SNS FIFO topic for the ledger, because a standard topic cannot deliver to a FIFO queue — each with its own consumer, sink, retry policy and shared dead-letter queue that pages on depth.

Template previewWeave
Rendering…

Make it your own.

{
  "nodes": [
    { "id": "qf", "type": "container", "label": "Subscriptions", "x": 480, "y": 40, "width": 200, "height": 620, "fill": "rgba(255,247,237,0.28)", "stroke": "#c2410c" },
    { "id": "cf", "type": "container", "label": "Consumers",              "x": 730, "y": 40, "width": 240, "height": 620, "fill": "rgba(219,234,254,0.26)", "stroke": "#1d4ed8" },

    { "id": "pub", "type": "microservice", "label": "Order service (publisher)", "x": 40,  "y": 240, "width": 180, "height": 104, "fill": "#dbeafe", "stroke": "#1d4ed8", "bold": true },
    { "id": "top", "type": "aws-sns",      "label": "SNS — order-events",        "x": 280, "y": 237, "width": 140, "height": 110, "fill": "#fff7ed", "stroke": "#f97316", "bold": true },
    { "id": "topf", "type": "aws-sns",     "label": "SNS FIFO — order-events.fifo", "x": 280, "y": 512, "width": 140, "height": 110, "fill": "#fff7ed", "stroke": "#f97316" },
    { "id": "fnote", "type": "note",       "label": "A standard topic cannot deliver to a FIFO queue — ordering needs a FIFO topic on both ends", "x": 60, "y": 512, "width": 190, "height": 106, "fill": "#fef9c3", "stroke": "#ca8a04" },

    { "id": "q1", "type": "aws-sqs", "label": "SQS — fulfilment", "x": 505, "y": 90,  "width": 140, "height": 110, "fill": "#fff7ed", "stroke": "#f97316" },
    { "id": "q2", "type": "aws-sqs", "label": "SQS — analytics",  "x": 505, "y": 230, "width": 140, "height": 110, "fill": "#fff7ed", "stroke": "#f97316" },
    { "id": "q3", "type": "aws-sqs", "label": "SQS — invoicing",  "x": 505, "y": 370, "width": 140, "height": 110, "fill": "#fff7ed", "stroke": "#f97316" },
    { "id": "q4", "type": "aws-sqs", "label": "SQS FIFO — ledger","x": 505, "y": 510, "width": 140, "height": 110, "fill": "#fff7ed", "stroke": "#f97316" },

    { "id": "c1", "type": "aws-lambda",       "label": "Lambda — pick list",  "x": 760, "y": 90,  "width": 140, "height": 110, "fill": "#fff7ed", "stroke": "#f97316" },
    { "id": "c2", "type": "docker-container", "label": "ECS — analytics writer","x": 760, "y": 233, "width": 180, "height": 104, "fill": "#dbeafe", "stroke": "#1d4ed8" },
    { "id": "c3", "type": "aws-lambda",       "label": "Lambda — invoice PDF","x": 760, "y": 370, "width": 140, "height": 110, "fill": "#fff7ed", "stroke": "#f97316" },
    { "id": "c4", "type": "docker-container", "label": "ECS — ledger writer", "x": 760, "y": 513, "width": 180, "height": 104, "fill": "#dbeafe", "stroke": "#1d4ed8" },

    { "id": "wms",  "type": "package", "label": "Warehouse system",   "x": 1020, "y": 90,  "width": 160, "height": 104, "fill": "#dcfce7", "stroke": "#15803d" },
    { "id": "lake", "type": "data-lake",  "label": "S3 — analytics lake","x": 1020, "y": 233, "width": 170, "height": 104, "fill": "#fef3c7", "stroke": "#b45309" },
    { "id": "inv",  "type": "aws-s3",     "label": "S3 — invoices",      "x": 1020, "y": 370, "width": 130, "height": 110, "fill": "#fff7ed", "stroke": "#f97316" },
    { "id": "ledg", "type": "cylinder",   "label": "Postgres — ledger",  "x": 1020, "y": 530, "width": 170, "height": 70,  "fill": "#fef3c7", "stroke": "#b45309" },

    { "id": "dlq", "type": "aws-sqs",    "label": "SQS — dead letter",       "x": 505, "y": 700, "width": 140, "height": 110, "fill": "#fee2e2", "stroke": "#b91c1c" },
    { "id": "alm", "type": "bell",       "label": "Alarm — DLQ depth > 0",   "x": 730, "y": 703, "width": 190, "height": 104, "fill": "#fee2e2", "stroke": "#b91c1c" },
    { "id": "oc",  "type": "user-group", "label": "On-call rota",            "x": 960, "y": 703, "width": 150, "height": 104, "fill": "#f1f5f9", "stroke": "#475569" },
    { "id": "rp",  "type": "note",       "label": "Retry: 3 attempts, exponential back-off, 12 h retention", "x": 40, "y": 420, "width": 210, "height": 90, "fill": "#fef9c3", "stroke": "#ca8a04" }
  ],
  "edges": [
    { "id": "n1",  "source": "pub", "target": "top", "label": "publish",            "thickness": 3 },
    { "id": "n2",  "source": "top", "target": "q1",  "label": "type = orderPlaced",  "thickness": 2 },
    { "id": "n3",  "source": "top", "target": "q2",  "label": "all message types" },
    { "id": "n4",  "source": "top", "target": "q3",  "label": "type = paymentTaken" },
    { "id": "n5",  "source": "topf", "target": "q4",  "label": "ordered by accountId" },
    { "id": "n6",  "source": "q1",  "target": "c1" },
    { "id": "n7",  "source": "q2",  "target": "c2" },
    { "id": "n8",  "source": "q3",  "target": "c3" },
    { "id": "n9",  "source": "q4",  "target": "c4" },
    { "id": "n10", "source": "c1",  "target": "wms" },
    { "id": "n11", "source": "c2",  "target": "lake" },
    { "id": "n12", "source": "c3",  "target": "inv" },
    { "id": "n13", "source": "c4",  "target": "ledg" },
    { "id": "n14", "source": "q1",  "target": "dlq", "label": "after 3 attempts", "style": "dashed" },
    { "id": "n15", "source": "q3",  "target": "dlq", "style": "dashed" },
    { "id": "n16", "source": "dlq", "target": "alm" },
    { "id": "n17", "source": "alm", "target": "oc",  "label": "page" },
    { "id": "n18", "source": "rp",  "target": "q1",  "style": "dashed" },
    { "id": "n19", "source": "q2",  "target": "dlq", "style": "dashed" },
    { "id": "n20", "source": "q4",  "target": "dlq", "style": "dashed" },
    { "id": "n21", "source": "pub", "target": "topf", "label": "publish (ordered)" }
  ]
}