RabbitMQ Concepts
debt(d8/e5/b6/t7)
Closest to 'silent in production' (d8), detection_hints.automated is no — non-durable queues and missing acks only manifest on broker restart or consumer crash, slightly better than d9 because integration testing with restart scenarios can catch it.
Closest to 'touches multiple files' (e5), quick_fix requires durable flag on queue declarations, delivery_mode=2 on every publish, manual ack on every consumer, plus DLX setup — spans producer and consumer code across the messaging layer.
Closest to 'strong gravitational pull' (b6), applies to queue-worker and cli contexts; routing topology choices (fanout/topic/direct) shape how every producer and consumer is written, slightly less than b7 because it's contained to the messaging subsystem.
Closest to 'serious trap' (t7), misconception explicitly states devs assume persistence-by-default which contradicts RabbitMQ's actual ephemeral default — and auto-ack default similarly contradicts the safe expectation, a serious cross-tool surprise.
TL;DR
Explanation
RabbitMQ architecture: Producers send to Exchanges. Exchanges route to Queues via Bindings. Consumers read from Queues. Exchange types: Direct (exact routing key), Topic (pattern matching: orders.#), Fanout (broadcast to all bound queues), Headers (route by header values). Key features: acknowledgements (manual ack for reliability), dead letter exchanges (DLX — failed messages routed), message TTL, queue TTL, priority queues, delayed messages (plugin), publisher confirms. Shovel/Federation for multi-broker topology. PHP: php-amqplib, Symfony Messenger AMQP transport.
Common Misconception
Why It Matters
Common Mistakes
- Not marking queues and messages as durable — lost on broker restart.
- Not using manual acknowledgements — auto-ack loses messages on consumer crash.
- Ignoring the dead letter exchange — failed messages silently disappear.
Code Examples
// Auto-ack + non-durable — messages lost on crash:
$channel->queue_declare('orders');
$channel->basic_consume('orders', '', false, true); // auto-ack!
// Durable queue + manual ack:
$channel->queue_declare('orders', false, true); // durable=true
$channel->basic_consume('orders', '', false, false, false, false,
function($msg) use ($channel) {
try {
processOrder($msg->body);
$msg->ack();
} catch (Exception $e) {
$msg->nack(false, false); // Dead letter
}
}
);