RabbitMQ 灵活的 exchanges 和 bindings 支持各种消息传递模式 — work queues、publish/subscribe、routing、topics 和 request/reply (RPC)。理解这些模式是有效使用 RabbitMQ 应对不同通信需求的关键。
Work queues(任务分配)
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(广播)
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)
