queue ใน RabbitMQ เก็บข้อความไว้จนกว่า consumer จะประมวลผล — ทำหน้าที่เป็น buffer ระหว่าง producer และ consumer การเข้าใจคุณสมบัติของ queue (durability, acknowledgment ฯลฯ) มีความสำคัญต่อการส่งข้อความที่เชื่อถือได้
queue ทำอะไร
A QUEUE holds messages until a consumer takes them:
→ messages wait in the queue (a buffer) → decouples producer speed from consumer speed
→ consumers receive messages (push or pull), process them, and ACKNOWLEDGE
→ roughly FIFO (first-in, first-out) order
→ the buffer between producers and consumers (absorbs load, enables async)
คุณสมบัติสำคัญของ queue
DURABLE → the queue survives a broker RESTART (the queue definition persists)
(+ PERSISTENT messages → messages also survive restart → durability)
EXCLUSIVE → used by only one connection; deleted when that connection closes
AUTO-DELETE → deleted when the last consumer disconnects
TTL → messages (or the queue) can expire after a time
MAX LENGTH → limit queue size (drop/overflow when full)
→ configure based on durability and lifecycle needs
