Prompt
Should I use Pub/Sub, RabbitMQ, or Kafka for service-to-service events?
Latest observation
Oct 24, 2026
OpenAI APIWeb search: off
It depends on what you mean by “service-to-service events,” because Pub/Sub, RabbitMQ, and Kafka solve slightly different problems.
Quick rule of thumb
- Use Pub/Sub (e.g., Google Cloud Pub/Sub) if you want a managed event bus with simple decoupling, fan-out, and low ops overhead.
- Use RabbitMQ if you need traditional message queues, complex routing, work distribution, priorities, or per-message acknowledgements in a more “task queue” style.
- Use Kafka if you need high-throughput event streaming, durable event logs, replay, and multiple independent consumers over time.
When each is a good fit
Pub/Sub
Best for:
- Cloud-native service eventing
- Loose coupling between services
- Broadcast/fan-out patterns
- Minimal infrastructure management
Strengths:
- Managed service
- Scales well
- Good for event-driven architectures
- Easy to integrate in cloud ecosystems
Tradeoffs:
- Less control than self-managed brokers
- Not ideal if you need rich routing semantics like RabbitMQ
- Not a full event log in the Kafka sense
RabbitMQ
Best for:
- Command/task queues
- Complex routing rules
- RPC-like async workflows
- Reliable delivery with ack/retry patterns
Strengths:
- Very flexible routing
- Great for job queues
- Mature and widely used
- Easier than Kafka for classic queue semantics
Tradeoffs:
- Not ideal for very high-throughput event streaming
- Replay/history is not its core strength
- Requires more broker management than managed Pub/Sub
Kafka
Best for:
- Event sourcing
- Stream processing
- Audit/event history
- High-volume event pipelines
- Multiple consumer groups reading the same events independently
Strengths:
- Durable log of events
- Replayability
- High throughput
- Strong ecosystem for stream processing
Tradeoffs:
- More operational complexity
- Overkill for simple service-to-service messaging
- Harder to reason about than a queue if you just need “do this job”
If your use case is specifically “service-to-service events”
In most modern microservice systems:
- If you want “something happened” notifications between services, and you’re on a major cloud, Pub/Sub is often the simplest choice.
- If you need reliable work distribution or complex routing, choose RabbitMQ.
- If you need event history, replay, analytics, or stream processing, choose Kafka.
Simple decision matrix
| Need | Best fit |
|---|---|
| Lowest ops / managed service | Pub/Sub |
| Complex routing / task queues | RabbitMQ |
| Event replay / event log | Kafka |
| High throughput streaming | Kafka |
| Simple pub-sub notifications | Pub/Sub |
| Per-message job processing | RabbitMQ |
Practical recommendation
If you’re building a typical microservice architecture and just need services to react to domain events, I’d choose:
- Pub/Sub if you’re already on GCP/AWS/Azure-managed equivalents and want simplicity.
- Kafka if you expect event streaming, replay, or analytics needs to grow.
- RabbitMQ if this is really a queue/workflow problem, not an event-streaming problem.
If you want, I can also give you a “choose one in 30 seconds” flowchart based on your workload, cloud provider, and consistency/replay requirements.