12 个版本 (6 个重大更新)
| 新版本 0.7.2 | 2024 年 8 月 12 日 |
|---|---|
| 0.7.0 | 2024 年 7 月 31 日 |
| 0.1.1 | 2023 年 11 月 15 日 |
在 测试 中排名 179
每月下载 659 次
10KB
92 代码行
非官方 Rust Redpanda 测试容器
非官方 Redpanda 测试容器。Redpanda 是一个简单、强大且成本效益高的流式数据处理平台,兼容 Kafka API,但比 Kafka 更简单、更快、更便宜。
添加依赖项
testcontainers-redpanda-rs = { version = "0.7" }
创建并运行 Redpanda 容器
use testcontainers_redpanda_rs::*;
#[tokio::main]
async fn main() {
let container = Redpanda::latest();
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);
}
关于版本兼容性的说明
0.7.x支持testcontainers0.210.6.x支持testcontainers0.200.5.x支持testcontainers0.190.4.x支持testcontainers0.180.3.x支持testcontainers0.170.2.x支持testcontainers0.160.1.x支持testcontainers0.15
依赖项
~21–33MB
~618K SLoC