Queue & Message Handling
Delivery guarantees, message ordering, consumer scaling.
Delivery guarantees — know the three and which one message brokers realistically give you: - At-most-once: message might be lost, never duplicated (rare in practice, generally undesirable). - At-least-once: message is never lost, but might be delivered more than once (the practical default for durable queues — this is why idempotent consumers are a hard requirement, not a nice-to-have). - Exactly-once: the ideal, genuinely hard to guarantee end-to-end across a distributed system — usually what people actually mean is "at-least-once delivery + idempotent processing", which achieves the same effective outcome without needing true exactly-once transport semantics.
Ordering — a single queue with a single consumer preserves order; scale out to multiple concurrent
consumers on the same queue and you generally lose strict ordering (different messages processed at
different speeds) unless you specifically partition messages (e.g. all messages for a given OrderId
routed to the same consumer/partition) to preserve order within that partition only.
Consumer scaling — more consumer instances on the same queue = more parallel throughput, at the ordering cost above, and only helps up to the point the queue itself/downstream (e.g. the database) can keep up.