Spring Batch - Integration Tests | TestContainer Apache Kafka

Опубликовано: 18 Март 2026
на канале: Bayonne Sensei
683
16

GitHub: https://github.com/PascoalBayonne/Bat...

Testcontainers can be used to automatically instantiate and manage Apache Kafka containers. More precisely Testcontainers uses the official Docker images for Confluent OSS Platform

Benefits
Running a single node Kafka installation with just one line of code
No need to manage external Zookeeper installation, required by Kafka. But see below.

In this video we have tested (Integration Tests) a spring batch application that writes items to a kafka topic. The tests use TestsContainers for Kafka.


You can find the application used in this example here:
   • Spring Batch - Apache Kafka (KafkaItemWriter)   and this one here is more recent:    • Spring Batch:  How to write items to multi...  

#springbatch
#testscontainers
#springkafka