testcontainers-redpanda-rs

Crates.iotestcontainers-redpanda-rs
lib.rstestcontainers-redpanda-rs
version0.12.0
created_at2023-11-15 09:08:28.04142+00
updated_at2025-07-30 07:26:31.307576+00
descriptionUnofficial redpanda test container
homepagehttps://github.com/milenkovicm/testcontainers-redpanda-rs
repositoryhttps://github.com/milenkovicm/testcontainers-redpanda-rs
max_upload_size
id1036321
size99,409
Marko Milenković (milenkovicm)

documentation

README

Unofficial Rust Test Container For Redpanda

github action Crates.io Crates.io

Unofficial testcontainer for Redpanda. Redpanda is a simple, powerful, and cost-efficient streaming data platform that is compatible with Kafka APIs but much less complex, faster and more affordable.

Add dependency:

testcontainers-redpanda-rs = { version = "0.12" }

Create and run redpanda container:

use testcontainers_redpanda_rs::*;

#[tokio::main]
async fn main() {
    let container = Redpanda::default();

    let server_node = container.start().await.unwrap();
    let bootstrap_servers = format!("localhost:{}", server_node.get_host_port_ipv4(REDPANDA_PORT).await.unwrap());
    // if topic has only one partition this part is optional
    // it will be automatically created when client connects
    server_node.exec(Redpanda::cmd_create_topic("test_topic", 3)).await.unwrap();

    println!("Redpanda server: {}", bootstrap_servers);
}

Explicit dependency on testcontainers is not needed.

Note about version compatibility:

  • 0.12.x supports testcontainers 0.25
  • 0.11.x supports testcontainers 0.24
  • 0.10.x supports testcontainers 0.23
Commit count: 89

cargo fmt