exchange และ binding ที่ยืดหยุ่นของ RabbitMQ รองรับ messaging pattern ต่าง ๆ — work queue, publish/subscribe, routing, topic และ request/reply (RPC) การเข้าใจ pattern เหล่านี้เป็นกุญแจสู่การใช้ RabbitMQ สำหรับความต้องการสื่อสารที่แตกต่างกัน
work queue (การกระจาย task)
WORK QUEUE → distribute tasks among multiple WORKERS (competing consumers):
→ producer → queue → multiple consumers (each message to ONE worker) → parallel processing
→ for: distributing background work; scaling task processing
publish/subscribe (การ broadcast)
PUB/SUB → broadcast a message to MULTIPLE consumers (each gets a copy):
→ FANOUT exchange → every bound queue gets the message → all consumers receive it
→ for: broadcasting events to all interested parties (notifications, updates)
