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
I am trying to setup multiple HttpServer instances listening on different random ports in my application using the port 0 method. The first one works, however subsequent ones do not and the actualPort() method reports 0. The same technique used with NetServer works as expected with each instance reporting a random port in actualPort();
Using Clement's excellent starter app to reproduce. Change the start method to
@Override
public void start() {
vertx.createHttpServer()
.requestHandler(req -> req.response().end("Hello Vert.x!"))
.listen(0, res -> System.out.println("Http Port " + res.result().actualPort()));
vertx.createHttpServer()
.requestHandler(req -> req.response().end("Hello Vert.x!"))
.listen(0, res -> System.out.println("Http Port " + res.result().actualPort()));
vertx.createNetServer()
.connectHandler(req -> {})
.listen(0, res -> System.out.println("Net Port " + res.result().actualPort()));
vertx.createNetServer()
.connectHandler(req -> {})
.listen(0, res -> System.out.println("Net Port " + res.result().actualPort()));
}
Output
Aug 30, 2016 11:08:23 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
INFO: Succeeded in deploying verticle
Http Port 52550
Http Port 0
Net Port 52551
Net Port 52552
The text was updated successfully, but these errors were encountered:
@vietj we've seen that Quarkus (even on latest 'main' with Vert.x 4.5.5) still bound both HTTP servers (the "main" one and the one for management endpoints) to the same port, when both HTTP servers were configured with port=0. Not sure whether this issue was meant to fix the same issue or not - so just a heads-up.
Strike that. I didn't look at the creation date of this issue. Sorry for the noise.
I am trying to setup multiple HttpServer instances listening on different random ports in my application using the port 0 method. The first one works, however subsequent ones do not and the actualPort() method reports 0. The same technique used with NetServer works as expected with each instance reporting a random port in actualPort();
Using Clement's excellent starter app to reproduce. Change the start method to
Output
The text was updated successfully, but these errors were encountered: