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
Copy file name to clipboardExpand all lines: docs/modules/kafka.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,18 @@ Create a `KafkaContainer` to use it in your tests:
54
54
[Creating a KafkaContainer](../../modules/kafka/src/test/java/org/testcontainers/kafka/KafkaContainerTest.java) inside_block:constructorWithVersion
55
55
<!--/codeinclude-->
56
56
57
+
### withNetworkAliases
58
+
59
+
The first alias host name defined using `withNetworkAliases` configures port 9092. Example for `kafka:9092`:
60
+
61
+
<!--codeinclude-->
62
+
[Creating a KafkaContainer](../../modules/kafka/src/test/java/org/testcontainers/kafka/KafkaContainerTest.java) inside_block:registerAlias
63
+
<!--/codeinclude-->
64
+
65
+
This works with `org.testcontainers.kafka.KafkaContainer` and `org.testcontainers.kafka.ConfluentKafkaContainer` but not with deprecated `org.testcontainers.containers.KafkaContainer`.
66
+
67
+
It only works if `withListener` is not used.
68
+
57
69
## Options
58
70
59
71
### <aname="zookeeper"></a> Using external Zookeeper
0 commit comments