Description

Kafka is an open-source distributed event streaming platform for high-performance data pipelines, streaming analytics, data integration, and mission-critical applications.

Examples

Dependency:
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>kafka</artifactId>
    <version>1.20.1</version>
    <scope>test</scope>
</dependency>
Usage:
var kafka = new KafkaContainer("apache/kafka-native:3.8.0");
kafka.start();
Dependency:
go get github.com/testcontainers/testcontainers-go/modules/kafka
Usage:
kafkaContainer, err := kafka.Run(ctx, "confluentinc/confluent-local:7.5.0")
Dependency:
dotnet add package Testcontainers.Kafka --version 3.9.0
Usage:
var kafkaContainer = new KafkaBuilder()
  .WithImage("confluentinc/cp-kafka:6.2.10")
  .Build();
await kafkaContainer.StartAsync();
Dependency:
npm install @testcontainers/kafka --save-dev
Usage:
const kafkaContainer = await new KafkaContainer().withExposedPorts(9093).start();
Dependency:
pip install testcontainers[kafka]
Usage:
with KafkaContainer() as kafka:
    connection = kafka.get_bootstrap_server()