Skip to content

Remove use of implicit network for multi-container Kafka #3128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/modules/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ If your test needs to run some other Docker container which needs access to the
* Use `kafka.getNetworkAliases().get(0)+":9092"` as bootstrap server location.
Or just give your Kafka container a network alias of your liking.

You will need to explicitly create a network and set it on the Kafka container as well as on your other containers that need to communicate with Kafka.

## Adding this module to your project dependencies

Add the following dependency to your `pom.xml`/`build.gradle` file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void testExternalZookeeperWithExternalNetwork() throws Exception {
.withEnv("ZOOKEEPER_CLIENT_PORT", "2181");

// withKafkaNetwork {
GenericContainer application = new GenericContainer("alpine").withNetwork(kafka.getNetwork())
GenericContainer application = new GenericContainer("alpine").withNetwork(network)
// }
.withNetworkAliases("dummy")
.withCommand("sleep 10000")
Expand Down