Messaging
Asynchronous messaging decouples producers from consumers and enables event-driven architectures that scale horizontally. Kafka is the dominant distributed log for high-throughput streaming; RabbitMQ handles traditional message queuing. Understanding when to use async messaging vs. synchronous REST calls is a system-design interview staple.
What You'll Find Here
Notes are being added. Planned topics:
| Topic | Description |
|---|---|
| Kafka Fundamentals | Topics, partitions, offsets, consumer groups, replication. |
| Spring Kafka | @KafkaListener, KafkaTemplate, deserializer configuration, error handling. |
| RabbitMQ Basics | Exchanges (Direct, Topic, Fanout), queues, bindings, AMQP model. |
| Spring AMQP | @RabbitListener, RabbitTemplate, dead-letter queues. |
| Async Patterns | At-least-once vs. exactly-once, idempotency, outbox pattern, saga pattern. |
Learning Path
- Kafka Fundamentals — topics, partitions, and consumer groups are the core model; understand these before Spring Kafka.
- Spring Kafka —
@KafkaListenerandKafkaTemplateare the practical APIs; focus on error handling and DLT. - Async Patterns — exactly-once semantics and the outbox pattern are senior-level design topics.
- RabbitMQ — understand the exchange/queue/binding model; contrast with Kafka's log model.
Related Domains
- Spring Boot —
spring-boot-starter-*-kafkaand AMQP starters auto-configure messaging. - System Design — messaging enables event-driven and microservices architectures.
- Testing — Testcontainers runs embedded Kafka and RabbitMQ for integration tests.