/cc @bclozel
What issue was that @mbhave @bclozel ???
It all depends on the server concepts and infrastructure, but several servers support binding to several ports/addresses at the same time. Undertow can connect through multiple channels, Tomcat can be configured with multiple connectors.
Is there a similar construct in Reactor Netty? Or is the recommended approach to start multiple HttpServer instances?
I suppose yes, depends on what you expected to share. The handler callback cannot be shared in essence its fine to reuse it, the rest is pretty close to tcp level and should be kept isolated this way.
I think we can add that support directly once we revamp the high level lifecycle API/SPI for client/server which seems def. to be the most awaited improvement in our next major version.
I'm wondering when the next milestone release will be and if there will be any plans to pull this into it?
v1.0.0 version already released,from release notes i can't find any new features and improvements about reactor-netty support multiple connectors, the new version support this feature?
@ctlove0523 No this feature wasn't able to be part of the 1.0.0 GA and was left for post 1.0.0 GA
We will try to schedule this for some of the next SPs.
Having this recent issue https://github.com/netty/netty/issues/10781#issuecomment-723176224 and that by default Reactor Netty Servers/Clients share the LoopResources and that Reactor Netty Server is 1:1 with ServerTransport (similar to ServerBootstrap), I tend to resolve this issue with won't fix. However I will keep it open for some time in case any requirements/discussions appear.
Having several connectors is as easy as the code below:
//This provides common configuration
//Shared event loop
HttpServer server = HttpServer.create()
.........; //some configuration
//This binds on port 7070
HttpServer server1 = server.port(7070);
//This binds on port 8080
HttpServer server2 = server.port(8080);
//This binds on port 9090 and enables security
HttpServer server3= server.port(9090)
.secure(.....);
While discussing this in the context of spring-projects/spring-boot#12035, I was wondering how should we handling this particular case: two servers running on different ports, but sharing the same Micrometer meter registry. Given the metrics share the same name, we'd end up with two different servers publishing different values to the same metric name?
When it comes to metrics like Gauge, adding a tag with the port being used won't really help.
PS: I think the reactor team made the right call with this, not trying to emulate a Connector model where nothing in its current architecture suggests such a thing. I'm currently trying to check if and how we should support the "multiple connectors" model in Spring Boot with Reactor Netty.
I'm closing this issue. We can reopen it in case there are any requirement.
v1.0.0 version already released,from release notes i can't find any new features and improvements about reactor-netty support multiple connectors, the new version support this feature?
Is there a better spring cloud gateway multi port support solution?
/ping @violetagg @bclozel
@yuchonghua Spring Cloud Gateway is Spring Boot application. (see https://github.com/spring-projects/spring-boot/issues/12035)
Most helpful comment
I'm wondering when the next milestone release will be and if there will be any plans to pull this into it?