-
Notifications
You must be signed in to change notification settings - Fork 46
There's no way to configure a port to listen on #38
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
Comments
That seems like a reasonable request. With being able to start multiple brokers, each with the possibility of using multiple listeners, it gets a bit tricky on how to supply/configure ports for each broker when they all need to be bound to unique ports. Do you have any suggestions/ideas on how you could see this working? Perhaps define a base port number for each listener, and then every broker offsets that port by its brokerId? Example: @ClassRule
public static final SharedKafkaTestResource sharedKafkaTestResource = new SharedKafkaTestResource()
// Start a cluster with 2 brokers.
.withBrokers(2)
// Register and configure SSL authentication on cluster.
.registerListener(new SslListener().onPort(12345));
Where brokerId 0 listens on port 12345, and brokerId 1 listens on port 12346? Thanks! |
May be it's better to use '.onPortRange(12345, 12348)? If the port range is lesser than amount of brokers - raise WrongConfigurationException(). |
@wr-pkazlenka checkout PullRequest #39 and let me know if this seems good? Thanks! |
@Crim , thank you. The way it is implemented seems even better, than my initial suggestion. |
Great I'll merge this in and cut a release today. Thanks for the suggestion and help! |
Released 3.2.0 to maven central. Let me know if you run into any issues. Thanks! |
Hi,
Seems like possibility to set listener's port is removed in commit #28. Now it's being generated randomly.
Can you return 'port' broker property or add something like 'port.range' = "9000-9005" option so I can launch kafka on the port I want to.
Use case:
In tests first launch application with already configured kafka client, then start kafka server, passing to the kafka server configuration the port, where client is expected to connect to.
The text was updated successfully, but these errors were encountered: