Skip to content

Redpanda

Testcontainers can be used to automatically instantiate and manage Redpanda containers. More precisely Testcontainers uses the official Docker images for Redpanda

Note

This module uses features provided in docker.redpanda.com/vectorized/redpanda.

Example

Create a Redpanda to use it in your tests:

RedpandaContainer container = new RedpandaContainer("docker.redpanda.com/vectorized/redpanda:v22.2.1")

Now your tests or any other process running on your machine can get access to running Redpanda broker by using the following bootstrap server location:

container.getBootstrapServers()

Adding this module to your project dependencies

Add the following dependency to your pom.xml/build.gradle file:

testImplementation "org.testcontainers:redpanda:1.17.4"
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>redpanda</artifactId>
    <version>1.17.4</version>
    <scope>test</scope>
</dependency>