Why use a queue at all
A message queue is an in-between buffer for producers that emit messages and consumers that process them. Three things you get from inserting one:
- Decoupling: producer doesn't need to know who consumes, or even if anyone is listening right now.
- Smoothing: bursts get absorbed by the queue instead of overwhelming consumers.
- Retries: a consumer that fails can simply re-receive the same message later.
What you give up: synchronous responses. The producer is told "message accepted", not "work done". For request-response semantics, queues are the wrong tool โ use a synchronous API. For background work, async fan-out, and inter-service events, they're the right one.
