How do point-to-point queues differ from pub/sub, push from pull, and events from commands?
Short answer
Queue: each message is handled by exactly one consumer, to share work; pub/sub: every subscriber gets a copy, to broadcast events. Push means the broker sends (RabbitMQ), pull means the consumer fetches (Kafka); a command is "do X", an event is "X happened".
3 points to say:
- Queues share work, pub/sub broadcasts; Kafka is a queue within a group, pub/sub across groups.
- Push has low latency but needs prefetch limits; pull has natural backpressure: slow consumers simply fetch slower.
- A command (one receiver, may be rejected) differs from an event (a fact that happened, many receivers): it decides topic/queue and who owns the schema.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.