Path 9 of 10
Spring Boot and Java Integration
Spring for Apache Kafka on Java 21 and Spring Boot 3: templates, listeners, error handling, transactions and tests.
0 / 6 lessons completed ยท about 173 min in total
After this path you can
Outcomes
- Configure producers and listeners explicitly
- Handle bad records, retries and dead letters in Spring
- Test Kafka code against a real broker with Testcontainers
Lessons
- 1Spring Kafka setup: what Boot builds and what you configureWire a Spring Boot service to Kafka: the beans Boot creates from spring.kafka properties, producer and consumer configuration, topics as code, profiles and a local KRaft broker.Intermediate30 min
- 2@KafkaListener in depth: threads, acknowledgements, batchesWhat runs behind @KafkaListener: the listener container and its threads, when offsets are committed in each ack mode, batch listeners, concurrency against partitions, and pausing.Advanced35 min
- 3Serialisation in Spring Kafka: JSON, type headers, AvroHow Java objects become record bytes and back: JsonSerializer and JsonDeserializer, type headers and trusted packages, ErrorHandlingDeserializer, and Avro with a schema registry.Intermediate30 min
- 4Error handling, retries and dead letters in SpringOne production-shaped Spring configuration: DefaultErrorHandler with a back-off, a dead-letter recoverer, ErrorHandlingDeserializer, and @RetryableTopic when retries must not block.Advanced26 min
- 5Kafka transactions in Spring BootWhat transaction-id-prefix switches on, the three ways Spring starts a Kafka transaction, and exactly what happens when a database transaction is involved as well.Advanced25 min
- 6Testing and observing Spring Kafka applicationsTest listeners as plain classes and against a real broker with Testcontainers, then make them observable: Micrometer metrics, traces across topics and safe, searchable logs.Advanced27 min
Related labs
Simulations, not a real cluster.
- Lab 1Producer publishing messagesFoundation20 min
- Lab 3Consumer group assignmentFoundation20 min
- Lab 4Adding and removing consumersIntermediate25 min
- Lab 5Duplicate message processingIntermediate25 min
- Lab 6Consumer crash before offset commitIntermediate25 min
- Lab 7Poison message and dead-letter queueIntermediate25 min
- Lab 8Retry and backoff strategyIntermediate30 min
- Lab 10Consumer lag during high loadIntermediate30 min
- Lab 12Transactional outboxAdvanced30 min
- Lab 13Database unavailable while consuming Kafka messagesAdvanced35 min
- Lab 14Kafka transactionAdvanced35 min
- Lab 15Schema evolutionAdvanced35 min