-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
use standard port 9092 in KafkaContainer #733
Conversation
@bsideup When can we expect a public release for this? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like an elegant solution to me.
@@ -62,7 +61,7 @@ public void start() { | |||
String networkAlias = getNetworkAliases().get(0); | |||
proxy = new SocatContainer() | |||
.withNetwork(getNetwork()) | |||
.withTarget(9092, networkAlias) | |||
.withTarget(9093, networkAlias) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be more consistent to use KAFKA_PORT
here (as well as in line 35).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kiview changed to constants, could you please re-check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Now, coming back to this after 2 months, I discovered that I don't understand how I should use KafkaContainer now :)
@bsideup Can you help me? Then I probably will can make a PR to your official documentation :) |
@iNikem that would be amazing!
|
@bsideup @iNikem has this been documented in the meantime? I am trying the exact use case right now. I have all containers including the application that uses Kafka in one Network. Then I have tests outside the network. The producer in the tests connects fine using
A quick google indicates it might have something to do with advertised hosts? |
@YNedderhoff With recent versions of testcontainers the following setup works nicely for me:
Then all containers can access Kafka on |
That's precisely my setup. Maybe it is actually working, I just know that my Spring app complains with that |
Ok - I think you are right. Despite that message the app seems to consume data alright. Confusing, but nice that it works :) Thank you! |
See #732