You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you create a network, and places two containers on custom networks with a kafka container and another container, kafdrop for example. There is an error.
After investigating, I think the implementation of StartupCallback is not good.
The code actually use Hostname, the test process resolves the container address '127.0.0.1'.
KAFKA_ADVERTISED_LISTENERS specifies the IP addresses and ports that Kafka clients should use to connect to the brokers.
Here is a sample code with a KafkaBuilder and a ContainerBuilder ( kafdrop) to reproduce this error:
varnetwork=newNetworkBuilder().Build();varkafdropContainer=newContainerBuilder().WithImage("obsidiandynamics/kafdrop:latest").WithPortBinding(9000,9000).WithNetwork(network).WithNetworkAliases("kafdrop").WithEnvironment("KAFKA_BROKERCONNECT","kafka:9092").Build();this._kafkaContainer=newKafkaBuilder().WithImage("confluentinc/cp-kafka:7.8.0").WithPortBinding(9092,KafkaBuilder.KafkaPort).WithPortBinding(9093,KafkaBuilder.BrokerPort).WithNetwork(network).WithNetworkAliases("kafka").Build();awaitkafdropContainer.StartAsync();// Start the Kafka containerawaitthis._kafkaContainer.StartAsync();
Thanks,
Relevant log output
Additional information
No response
The text was updated successfully, but these errors were encountered:
After further investigation, the host name is really important for the testing process. I think a better solution would be to add a new method in builder. This method would allow adding another listener, protocole and an advertised listener.
Thanks for creating the issue. I think it makes sense to look into Java's implementation and align it, if possible, with the .NET implementation. I just took a quick look, and indeed, they configure the environment variable differently.
Thanks for creating the issue. I think it makes sense to look into Java's implementation and align it, if possible, with the .NET implementation. I just took a quick look, and indeed, they configure the environment variable differently.
Testcontainers version
4.1.0
Using the latest Testcontainers version?
Yes
Host OS
MacOs
Host arch
ARM
.NET version
8.0.404
Docker version
Client: Version: 27.3.1 API version: 1.47 Go version: go1.22.7 Git commit: ce12230 Built: Fri Sep 20 11:38:18 2024 OS/Arch: darwin/arm64 Context: desktop-linux Server: Docker Desktop 4.36.0 (175267) Engine: Version: 27.3.1 API version: 1.47 (minimum version 1.24) Go version: go1.22.7 Git commit: 41ca978 Built: Fri Sep 20 11:41:19 2024 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.7.21 GitCommit: 472731909fa34bd7bc9c087e4c27943f9835f111 runc: Version: 1.1.13 GitCommit: v1.1.13-0-g58aa920 docker-init: Version: 0.19.0 GitCommit: de40ad0
Docker info
What happened?
When you create a network, and places two containers on custom networks with a kafka container and another container, kafdrop for example. There is an error.
After investigating, I think the implementation of StartupCallback is not good.
The code actually use Hostname, the test process resolves the container address '127.0.0.1'.
After
KAFKA_ADVERTISED_LISTENERS specifies the IP addresses and ports that Kafka clients should use to connect to the brokers.
Here is a sample code with a KafkaBuilder and a ContainerBuilder ( kafdrop) to reproduce this error:
Thanks,
Relevant log output
Additional information
No response
The text was updated successfully, but these errors were encountered: