What it is
Competing consumers run several consumers on the same point to point channel so they can process messages concurrently. Each message goes to exactly one consumer, but the consumers together drain the channel faster.
How it works
- Many consumer instances listen on the same channel.
- The channel hands each message to one available consumer.
- Idle consumers pick up the next message, balancing the load.
Why it matters
- Scales throughput by adding more consumers under load.
- Provides resilience: if one consumer dies, others keep working.
- Smooths bursts, since work spreads across the pool automatically.
This pattern relies on a point to point channel so two consumers never get the same message. Because work is spread, ordering is not guaranteed across consumers; if order matters, partition the channel so related messages go to the same consumer. Consumers should be idempotent, since a message redelivered after a crash may be retried by another consumer.
Key idea
Competing consumers share one point to point channel to process messages in parallel, scaling throughput while trading away global ordering.