viewof queueName = Inputs.text({
value: "temperature_alerts",
label: "Queue name:",
placeholder: "e.g. temperature_alerts"
})
viewof queueDurable = Inputs.radio(
["Durable (survives restart)", "Non-durable (removed on restart)"],
{value: "Durable (survives restart)", label: "Durability:"}
)
viewof queueExclusive = Inputs.checkbox(
["Exclusive (declaring connection only; deleted on disconnect)"],
{label: "Access mode:"}
)
viewof queueMaxLength = Inputs.range([0, 100000], {
value: 10000,
step: 1000,
label: "Max queue length (messages):",
format: x => x === 0 ? "Unlimited" : x.toLocaleString()
})
viewof queueTTL = Inputs.range([0, 3600000], {
value: 60000,
step: 5000,
label: "Message TTL (ms):",
format: x => x === 0 ? "No expiry" : x >= 60000 ? `${(x / 60000).toFixed(1)} min` : `${(x / 1000).toFixed(0)} sec`
})
viewof msgRate = Inputs.range([10, 5000], {
value: 500,
step: 10,
label: "Expected msg/sec:",
format: x => x.toLocaleString()
})Try It: Queue Configuration Builder
Try It: Queue Configuration Builder
animation
amqp
protocols
messaging
Try Change Max queue length (messages): from 10000 to 0.
Observe Watch Illustrative payload budget, Time to Fill, and Generated RabbitMQ Declaration as max queue length changes to 0.
Explain Explain why 0 max queue length gives an Unbounded illustrative payload budget.
Technical boundaries. Payload estimates assume 280 B/message and are not measured RAM. Time to Fill ignores consumers and TTL expiry; actual disk I/O needs measurement.
NoteTry It: Queue Configuration Builder
queueIsExclusive = queueExclusive.length > 0
queueIsDurable = queueDurable === "Durable (survives restart)" && !queueIsExclusive
estimatedMemoryMB = queueMaxLength > 0 ? (queueMaxLength * 280) / (1024 * 1024) : Infinity
timeToFill = queueMaxLength > 0 ? (queueMaxLength / msgRate) : Infinity
illustrativePayloadKBs = msgRate * 280 / 1024
html`<div style="background: #f8f9fa; border-left: 4px solid #9B59B6; padding: 15px; margin-top: 15px; font-family: Arial, sans-serif;">
<h4 style="color: #2C3E50; margin-top: 0;">Queue Configuration: <code>${queueName}</code></h4>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 12px;">
<div style="background: white; padding: 10px; border-radius: 4px; border: 1px solid #e0e0e0;">
<div style="color: #7F8C8D; font-size: 11px; text-transform: uppercase;">Illustrative payload budget</div>
<div style="color: #9B59B6; font-size: 22px; font-weight: bold; margin-top: 4px;">${estimatedMemoryMB === Infinity ? 'Unbounded' : estimatedMemoryMB.toFixed(1) + ' MB'}</div>
<div style="color: #7F8C8D; font-size: 11px;">280 B/message at max length (${queueMaxLength > 0 ? queueMaxLength.toLocaleString() : 'unlimited'} msgs); not measured RAM</div>
</div>
<div style="background: white; padding: 10px; border-radius: 4px; border: 1px solid #e0e0e0;">
<div style="color: #7F8C8D; font-size: 11px; text-transform: uppercase;">Time to Fill</div>
<div style="color: ${timeToFill < 30 ? '#E74C3C' : '#16A085'}; font-size: 22px; font-weight: bold; margin-top: 4px;">${timeToFill === Infinity ? 'N/A' : timeToFill < 60 ? timeToFill.toFixed(1) + 's' : (timeToFill / 60).toFixed(1) + ' min'}</div>
<div style="color: #7F8C8D; font-size: 11px;">At ${msgRate.toLocaleString()} msg/sec, ignoring consumers and TTL expiry</div>
</div>
<div style="background: white; padding: 10px; border-radius: 4px; border: 1px solid #e0e0e0;">
<div style="color: #7F8C8D; font-size: 11px; text-transform: uppercase;">Incoming payload estimate</div>
<div style="color: #E67E22; font-size: 22px; font-weight: bold; margin-top: 4px;">${illustrativePayloadKBs.toFixed(0)} KB/s</div>
<div style="color: #7F8C8D; font-size: 11px;">280 B/message assumed; actual disk I/O needs measurement</div>
</div>
</div>
<div style="margin-top: 12px; background: white; padding: 12px; border-radius: 4px; border: 1px solid #e0e0e0;">
<div style="color: #2C3E50; font-weight: bold; font-size: 13px; margin-bottom: 8px;">Generated RabbitMQ Declaration</div>
<pre style="background: #2C3E50; color: #e0e0e0; padding: 10px; border-radius: 4px; font-size: 12px; overflow-x: auto; margin: 0;">channel.queue_declare(
queue='${queueName}',
durable=${queueIsDurable ? 'True' : 'False'},
exclusive=${queueIsExclusive ? 'True' : 'False'},
auto_delete=${queueIsExclusive ? 'True' : 'False'},
arguments={${queueMaxLength > 0 ? `\n 'x-max-length': ${queueMaxLength},` : ''}${queueTTL > 0 ? `\n 'x-message-ttl': ${queueTTL},` : ''}
}
)</pre>
</div>
<div style="margin-top: 10px; padding: 8px; background: ${timeToFill < 30 ? '#fdf2f2' : queueIsExclusive ? '#fef9e7' : '#e8f8f5'}; border-radius: 4px; font-size: 12px; color: #2C3E50;">
${timeToFill < 30
? '<strong>Warning:</strong> Queue fills in under 30 seconds at current rate. Consider increasing max-length, adding consumers, or reducing message rate.'
: queueIsExclusive
? '<strong>Note:</strong> Exclusive queues belong to the declaring connection and are deleted when it closes; the generated declaration sets durable=False.'
: queueIsDurable
? '<strong>Recommendation:</strong> For restart survival, combine this durable queue with persistent messages and publisher confirms; TTL removes expired messages.'
: '<strong>Note:</strong> Transient queue will lose messages on broker restart. Suitable for real-time dashboards where stale data is not useful.'}
</div>
</div>`