Q21: What is the difference between a message queue and a publish-subscribe event bus?

Difficulty:MediumTopic:Messaging

A work queue typically distributes each message to one competing consumer so a task is processed by one worker group. Publish-subscribe lets multiple independent subscribers receive an event, each maintaining its own progress or subscription. Platforms may support both patterns. Choose based on whether the message represents a task to perform or a fact that multiple systems need to observe.

Key Takeaways
  • Queues distribute work; pub/sub distributes events to subscribers.
  • Clarify replay, retention, and per-subscriber delivery requirements.