Kafka Articles
4 articles about Kafka. Explore Spring Boot implementation, design, and operations across related topics.
-
How to Write Integration Tests with PostgreSQL, Kafka, and Redis Using Spring Boot Testcontainers
A practical guide to writing multi-container integration tests that simultaneously launch PostgreSQL, Kafka, and Redis using Spring Boot 3.1+'s @ServiceConnection, plus speeding up CI with reuse configuration.
-
Implementing the Transactional Outbox Pattern in Spring Boot
This article explains how to implement the Transactional Outbox pattern in Spring Boot to solve the dual-write problem between DB updates and Kafka messaging. It covers Outbox table design, relay via Poller, and comparison with Debezium CDC, complete with working code.
-
How to Implement Distributed Transactions in Microservices with the Saga Pattern in Spring Boot
A guide to implementing distributed transactions across microservices using the Saga pattern with Spring Boot + Kafka. Covers selection criteria for Choreography vs Orchestration types, compensating transaction design, and ensuring idempotency, complete with implementation code.
-
Implementing Kafka Producer and Consumer in Spring Boot - Beginner's Guide with Sample Code
A practical guide to implementing Kafka Producer and Consumer in a Spring Boot 3.x application from scratch using spring-kafka. Quickly start a broker with Docker Compose, then learn the basics of KafkaTemplate and @KafkaListener, retries and Dead Letter Topic forwarding with DefaultErrorHandler, and testing with @EmbeddedKafka—all explained with a code-centric approach.