SteelReed

Search

Search posts, questions…

Messaging & KafkaQuestion 2 / 21

Junior

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".

pub/sub across groupsqueue within groupEvent OrderPlacedTopic ordersGroup inventoryGroup emailOnly one consumer gets it

3 points to say:

  1. Queues share work, pub/sub broadcasts; Kafka is a queue within a group, pub/sub across groups.
  2. Push has low latency but needs prefetch limits; pull has natural backpressure: slow consumers simply fetch slower.
  3. 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.