viewof relMessageValue = Inputs.select(
["Low (telemetry, metrics)", "Medium (notifications, logs)", "High (orders, payments)", "Critical (safety, compliance)"],
{ value: "High (orders, payments)", label: "Message importance" }
)
viewof relBrokerRestart = Inputs.checkbox(["Broker may restart or crash"], {
value: ["Broker may restart or crash"],
label: "Environment risks"
})
viewof relConsumerCrash = Inputs.checkbox(["Consumers may crash mid-processing"], {
value: ["Consumers may crash mid-processing"],
label: "Consumer reliability"
})
viewof relMisrouting = Inputs.checkbox(["Routing keys or bindings may be misconfigured"], {
value: [],
label: "Routing risk"
})
viewof relQueueGrowth = Inputs.checkbox(["Consumers may fall behind or go offline"], {
value: [],
label: "Backpressure risk"
})Try It: Reliability Mechanism Checker
Try It: Reliability Mechanism Checker
animation
amqp
protocols
messaging
Try Change Message importance and Environment risks, then press Play scenario.
Observe Watch Required Reliability Mechanisms and Assessment after Play scenario.
Explain Describe how Message importance and Environment risks change recommended mechanisms after Play scenario.
Technical boundaries. Mechanisms are recommended from message importance and selected risks. Quorum Queue requires Critical importance and broker restart risk; Durable Queue and Persistent Messages require broker restart risk and at least Medium importance.
NoteTry It: Reliability Mechanism Checker
Select the characteristics of your messaging scenario and see which AMQP reliability mechanisms you need. This helps you avoid the common mistake of missing a critical configuration layer.
relValueLevel = relMessageValue.startsWith("Critical") ? 4 :
relMessageValue.startsWith("High") ? 3 :
relMessageValue.startsWith("Medium") ? 2 : 1
relNeedsDurable = relBrokerRestart.length > 0 && relValueLevel >= 2
relNeedsPersistent = relBrokerRestart.length > 0 && relValueLevel >= 2
relNeedsManualAck = relConsumerCrash.length > 0 && relValueLevel >= 2
relNeedsConfirms = relValueLevel >= 3
relNeedsMandatory = relMisrouting.length > 0 || relValueLevel >= 3
relNeedsAlternate = relMisrouting.length > 0
relNeedsDLX = relValueLevel >= 2
relNeedsLimits = relQueueGrowth.length > 0 || relValueLevel >= 2
relNeedsQuorum = relValueLevel >= 4 && relBrokerRestart.length > 0
relMechanisms = [
{ name: "Durable Queue", needed: relNeedsDurable, icon: "Q", desc: "Queue definition survives broker restart", color: "#3498DB" },
{ name: "Persistent Messages", needed: relNeedsPersistent, icon: "P", desc: "Messages written to disk (delivery_mode=2)", color: "#3498DB" },
{ name: "Manual Acknowledgment", needed: relNeedsManualAck, icon: "A", desc: "Consumer ACKs after processing (auto_ack=False)", color: "#16A085" },
{ name: "Publisher Confirms", needed: relNeedsConfirms, icon: "C", desc: "Broker confirms receipt to publisher", color: "#E67E22" },
{ name: "Mandatory Flag", needed: relNeedsMandatory, icon: "M", desc: "Error if message cannot be routed", color: "#E67E22" },
{ name: "Alternate Exchange", needed: relNeedsAlternate, icon: "X", desc: "Catch-all for unroutable messages", color: "#9B59B6" },
{ name: "Dead Letter Exchange", needed: relNeedsDLX, icon: "D", desc: "Captures rejected/expired messages", color: "#9B59B6" },
{ name: "Queue Limits (TTL + max-length)", needed: relNeedsLimits, icon: "L", desc: "Prevent unbounded queue growth", color: "#7F8C8D" },
{ name: "Quorum Queue", needed: relNeedsQuorum, icon: "H", desc: "Replicated queue for high availability", color: "#E74C3C" }
]
relNeededCount = relMechanisms.filter(m => m.needed).length
relTotalCount = relMechanisms.length
html`<div style="background: #f8f9fa; padding: 20px; border-radius: 8px; border-left: 4px solid #E67E22;">
<h3 style="margin-top: 0; color: #2C3E50;">Required Reliability Mechanisms</h3>
<p style="color: #7F8C8D; margin-bottom: 15px;">
Based on your scenario: <strong>${relNeededCount}</strong> of ${relTotalCount} mechanisms recommended
</p>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px;">
${relMechanisms.map(m => `
<div style="background: white; padding: 12px; border-radius: 6px; border: 2px solid ${m.needed ? m.color : '#ecf0f1'}; opacity: ${m.needed ? 1 : 0.5};">
<div style="display: flex; align-items: center; gap: 8px; margin-bottom: 6px;">
<span style="background: ${m.needed ? m.color : '#ecf0f1'}; color: ${m.needed ? 'white' : '#bdc3c7'}; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: bold; font-size: 13px;">${m.icon}</span>
<strong style="color: ${m.needed ? '#2C3E50' : '#bdc3c7'}; font-size: 0.9em;">${m.name}</strong>
</div>
<p style="color: ${m.needed ? '#7F8C8D' : '#bdc3c7'}; font-size: 0.875rem; line-height: 1.5; margin: 0;">${m.desc}</p>
<p style="margin: 4px 0 0 0; font-size: 0.8em; font-weight: bold; color: ${m.needed ? m.color : '#bdc3c7'};">${m.needed ? 'REQUIRED' : 'Optional'}</p>
</div>
`).join('')}
</div>
<div style="margin-top: 15px; padding: 12px; background: ${relValueLevel >= 3 ? '#fff3cd' : '#d4edda'}; border-radius: 6px; border: 1px solid ${relValueLevel >= 3 ? '#E67E22' : '#16A085'};">
<p style="margin: 0; color: #2C3E50; font-size: 0.95em;">
<strong>Assessment:</strong> ${
relValueLevel >= 4 ? 'Safety-critical system -- use ALL available reliability mechanisms. Missing any single layer could cause compliance violations or safety incidents.' :
relValueLevel >= 3 ? 'High-value messages require publisher confirms, durable queues, persistent messages, AND manual acknowledgment. Missing the mandatory flag is a common oversight that leads to silent message loss.' :
relValueLevel >= 2 ? 'Medium-value scenario benefits from basic reliability (durable + persistent + manual ACK). Consider adding publisher confirms if loss rate must be near zero.' :
'Low-value telemetry can use minimal reliability for maximum throughput. Auto-ack and transient messages are acceptable if occasional loss is tolerable.'
}
</p>
</div>
</div>`