Skip to main content

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:

TopicDescription
Kafka FundamentalsTopics, partitions, offsets, consumer groups, replication.
Spring Kafka@KafkaListener, KafkaTemplate, deserializer configuration, error handling.
RabbitMQ BasicsExchanges (Direct, Topic, Fanout), queues, bindings, AMQP model.
Spring AMQP@RabbitListener, RabbitTemplate, dead-letter queues.
Async PatternsAt-least-once vs. exactly-once, idempotency, outbox pattern, saga pattern.

Learning Path

  1. Kafka Fundamentals — topics, partitions, and consumer groups are the core model; understand these before Spring Kafka.
  2. Spring Kafka@KafkaListener and KafkaTemplate are the practical APIs; focus on error handling and DLT.
  3. Async Patterns — exactly-once semantics and the outbox pattern are senior-level design topics.
  4. RabbitMQ — understand the exchange/queue/binding model; contrast with Kafka's log model.
  • Spring Bootspring-boot-starter-*-kafka and AMQP starters auto-configure messaging.
  • System Design — messaging enables event-driven and microservices architectures.
  • Testing — Testcontainers runs embedded Kafka and RabbitMQ for integration tests.