-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Find a better way to detect when to start embedded servers #12973
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
From @rstoyanchev on SPR-16760
In my opinion the starter POMs should not be a direct indication of intent. I think it's important that starters only declare dependencies, and those dependencies are indirectly responsible for auto-configuration. The problem we have with
SPR-16760 is about splitting One option we could consider is moving |
Since with tomcat and jetty you have a clear conditional to use. |
In Spring Framework 5.1 you'll be able to use |
I am not sure to understand how that will help solving this. Spring Framework 5.1 will indeed allow to use Jetty as an alternative to Netty, but Netty should IMO remains the default client engine for various reasons: shared infra with the default server, more mature, more efficient memory allocation since Jetty currently only allows |
@sdeleuze then I'm not sure what do you have in mind - how could we solve this? |
Sorry in advance if that's a stupid proposal, but what about starting WebFlux server only when we find concrete indication of server-side code in user project. For the functional API, we could rely on something like |
Unfortunately I don't think that's an option since we need to make the decision about what |
What about the original suggestion at the top to move org.springframework.boot.web.embedded to a new jar? |
That's certainly still an option. I guess we were hoping that using |
I'll move this back to backlog and think about it some more. |
This would suggest doing one of those:
Right now I'm not convinced by either of those. |
I'm in favour of option 2. in Brian's list. But to clarify, that also requires splitting out the |
I'm not very keen to use the starter alone as an indication. I'd rather we keep starters purely as dependencies. |
Starters should not be used for anything else than providing dependencies and I think it would be a mistake changing that. As for the client starter, we had that request in the past (for MVC) and declined it independently of this issue. IMO, the bottom line of this issue is that netty isn't modularized (and so isn't I am concerned about the links Rossen has shared. Given that the status quo is to bring a complete server infrastructure with a full server implementation, I wonder if that choice shouldn't be reconsidered. |
Point taken, but couldn't we use the same logic programmatically, for example in |
I would be happy with either option, as I am struggling to keep my client library for ArcadeDB clean of any dependency to a web-server. An application using my library is free to choose to start a server or not, but my lib should not force the application to handle a dependency to a server if not needed. The above mentioned issue #34198 was opened by me, because I think a proper autoconfiguration should configure and start a server only if it is in the classpath. |
This will be addressed as part of the restructuring work for 4.0. The auto-configuration for |
See https://jira.spring.io/browse/SPR-16760 and rabbitmq/hop#122 for some of the issues we currently have detecting when to start a server for Spring WebFlux.
We need to consider the
spring-webflux
jar to be more likespring-web
and notspring-webmvc
. The webflux jar alone is not a strong enough signal that an embedded server should be started.The text was updated successfully, but these errors were encountered: