viewof criticalRate = Inputs.range([1, 100], {
value: 5,
step: 1,
label: "Critical alerts/min"
})
viewof warningRate = Inputs.range([10, 500], {
value: 50,
step: 5,
label: "Warning alerts/min"
})
viewof infoRate = Inputs.range([100, 10000], {
value: 1000,
step: 50,
label: "Info logs/min"
})
viewof criticalDelivery = Inputs.select(["persistent + quorum", "persistent + standard", "transient"], {
value: "persistent + quorum",
label: "Critical delivery mode"
})
viewof warningDelivery = Inputs.select(["persistent + quorum", "persistent + standard", "transient"], {
value: "persistent + standard",
label: "Warning delivery mode"
})
viewof infoDelivery = Inputs.select(["persistent + quorum", "persistent + standard", "transient"], {
value: "transient",
label: "Info delivery mode"
})Try It: Alert Routing Simulator
Try It: Alert Routing Simulator
animation
amqp
protocols
messaging
Try Set critical delivery mode to transient and critical alerts/min to 5.
Observe Watch Effective load and Latency with critical alerts/min at 5.
Explain Explain why transient delivery has 1x overhead.
Technical boundaries. Delivery modes use fixed throughput factors and latency values. Effective load is normalized to a transient baseline.
NoteTry It: Alert Routing Simulator
Configure alert severity levels and routing rules to see how messages flow through a topic exchange to different queues. Experiment with delivery modes and queue types to understand the cost-reliability tradeoff for each tier.
alertCostMap = ({
"persistent + quorum": { throughputFactor: 0.15, latencyMs: 25, overhead: "3-5x", color: "#E74C3C", label: "Highest reliability" },
"persistent + standard": { throughputFactor: 0.35, latencyMs: 12, overhead: "2-3x", color: "#E67E22", label: "High reliability" },
"transient": { throughputFactor: 1.0, latencyMs: 1, overhead: "1x", color: "#16A085", label: "Best effort" }
})
alertCriticalCfg = alertCostMap[criticalDelivery]
alertWarningCfg = alertCostMap[warningDelivery]
alertInfoCfg = alertCostMap[infoDelivery]
// Total broker load (normalized to transient baseline)
alertTotalLoad = (criticalRate / alertCriticalCfg.throughputFactor) +
(warningRate / alertWarningCfg.throughputFactor) +
(infoRate / alertInfoCfg.throughputFactor)
alertBaselineLoad = criticalRate + warningRate + infoRate
alertLoadRatio = (alertTotalLoad / alertBaselineLoad)
html`<div style="background: #f8f9fa; padding: 20px; border-radius: 8px; border-left: 4px solid #9B59B6;">
<h3 style="margin-top: 0; color: #2C3E50;">Alert Routing Configuration</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-top: 15px;">
<div style="background: white; padding: 15px; border-radius: 6px; border-top: 4px solid ${alertCriticalCfg.color};">
<h4 style="color: ${alertCriticalCfg.color}; margin-top: 0;">Critical Queue</h4>
<p style="font-size: 22px; font-weight: bold; color: #2C3E50; margin: 8px 0;">${criticalRate} msg/min</p>
<p style="color: #7F8C8D; margin: 4px 0;">Latency: ~${alertCriticalCfg.latencyMs}ms</p>
<p style="color: #7F8C8D; margin: 4px 0;">Overhead: ${alertCriticalCfg.overhead}</p>
<p style="color: ${alertCriticalCfg.color}; font-weight: bold; margin-top: 10px; font-size: 0.85em;">${alertCriticalCfg.label}</p>
<p style="color: #7F8C8D; font-size: 0.85em; margin: 4px 0;">routing: critical.#</p>
</div>
<div style="background: white; padding: 15px; border-radius: 6px; border-top: 4px solid ${alertWarningCfg.color};">
<h4 style="color: ${alertWarningCfg.color}; margin-top: 0;">Warning Queue</h4>
<p style="font-size: 22px; font-weight: bold; color: #2C3E50; margin: 8px 0;">${warningRate} msg/min</p>
<p style="color: #7F8C8D; margin: 4px 0;">Latency: ~${alertWarningCfg.latencyMs}ms</p>
<p style="color: #7F8C8D; margin: 4px 0;">Overhead: ${alertWarningCfg.overhead}</p>
<p style="color: ${alertWarningCfg.color}; font-weight: bold; margin-top: 10px; font-size: 0.85em;">${alertWarningCfg.label}</p>
<p style="color: #7F8C8D; font-size: 0.85em; margin: 4px 0;">routing: warning.#</p>
</div>
<div style="background: white; padding: 15px; border-radius: 6px; border-top: 4px solid ${alertInfoCfg.color};">
<h4 style="color: ${alertInfoCfg.color}; margin-top: 0;">Info Queue</h4>
<p style="font-size: 22px; font-weight: bold; color: #2C3E50; margin: 8px 0;">${infoRate} msg/min</p>
<p style="color: #7F8C8D; margin: 4px 0;">Latency: ~${alertInfoCfg.latencyMs}ms</p>
<p style="color: #7F8C8D; margin: 4px 0;">Overhead: ${alertInfoCfg.overhead}</p>
<p style="color: ${alertInfoCfg.color}; font-weight: bold; margin-top: 10px; font-size: 0.85em;">${alertInfoCfg.label}</p>
<p style="color: #7F8C8D; font-size: 0.85em; margin: 4px 0;">routing: info.#</p>
</div>
</div>
<div style="margin-top: 20px; padding: 15px; background: white; border-radius: 6px; border: 1px solid #ddd;">
<h4 style="color: #2C3E50; margin-top: 0;">Broker Resource Impact</h4>
<div style="display: flex; align-items: center; gap: 15px; margin: 10px 0;">
<span style="color: #7F8C8D; min-width: 130px;">Effective load:</span>
<div style="flex: 1; background: #ecf0f1; border-radius: 4px; height: 28px; overflow: hidden;">
<div style="width: ${Math.min(alertLoadRatio * 100 / 5, 100)}%; height: 100%; background: ${alertLoadRatio > 3 ? '#E74C3C' : alertLoadRatio > 2 ? '#E67E22' : '#16A085'}; border-radius: 4px; transition: width 0.3s;"></div>
</div>
<strong style="color: ${alertLoadRatio > 3 ? '#E74C3C' : alertLoadRatio > 2 ? '#E67E22' : '#16A085'};">${alertLoadRatio.toFixed(1)}x baseline</strong>
</div>
<p style="color: #7F8C8D; font-size: 0.9em; margin-top: 10px;">
Baseline (all transient): ${alertBaselineLoad.toLocaleString()} msg/min |
Effective load: ${Math.round(alertTotalLoad).toLocaleString()} msg/min equivalent
</p>
<p style="color: #7F8C8D; font-size: 0.9em; margin-top: 8px;">
<strong>Tip:</strong> ${alertLoadRatio > 3
? 'High overhead detected. Consider using transient delivery for high-volume info logs to reduce broker load.'
: alertLoadRatio > 2
? 'Moderate overhead. This configuration works for medium-scale deployments.'
: 'Efficient configuration. Reliability is matched appropriately to message criticality.'}
</p>
</div>
</div>`