-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Deprecate WebApplicationType and introduce alternative #16412
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
If we apply this change, this should be reflected in #16411 since the |
If I understand things correctly, RSocket complicates things quite a bit. Previously, the different types were only possible individually. For example, you couldn't have both a reactive and servlet application. With RSocket, you could have a server that is just RSocket, just reactive web, or reactive web and RSocket. The proposed enum doesn't have a value for the last of these three options. I wonder if we need to be thinking about being able to combine types instead. Perhaps the type needs to be an Anything we do here needs to be considered with #14814 in mind. Combining types doesn't feel like it will help… |
In the case of RSocket, you can have:
So I do think RSocket is blurring a bit the lines, but a simple enum would still work, as a WebFlux application with RSocket support in it is still a WebFlux application. |
Instead of creating a new application type for RSocket and rename the
So developers should be able to change Spring Boot's opinion by providing a configuration property for the RSocket port, or setting the |
Confirmed that the solution described in the last comment works. Closing this issue as a result. |
The
WebApplicationType
enum currently allows developers (and Spring Boot itself) to flag an application as a particular type. This can be done automatically given signals such as classpath or a specific choice of context. This can be done manually through setting a configuration property.This is useful when auto-detection is not picking up the choice expected by the user, for example:
spring-boot-starter-web
andspring-boot-starter-webflux
on the classpath will configure a Spring MVC application; changing that flag allows to switch to a WebFlux applicationspring-boot-starter-web
on the classpath will start a server, but developers might just want a simple CLI application without any serverIn #16021, the introduction of RSocket will require a new type of application. RSocket applications aren't necessarily web applications:
spring-boot-starter-webflux
andspring-boot-starter-rsocket
will start a WebFlux application and configure an RSocket endpoint on the serverspring-boot-starter-rsocket
should start a plain RSocket server; this does not qualify as a web applicationBecause we've got now more experience about this, we should consider now renaming that enum and reorganize our infrastructure around it. The goal behind this type is to say whether an application needs a server and if so, which type of server. Spring Boot is tying the chosen server to the application context.
We could have a new
ServerType
enum, with:ServerType.SERVLET
, orServerType.SERVLET_CONTAINER
?ServerType.REACTIVE
, orServerType.REACTIVE_WEB
(as RSocket is reactive too)?ServerType.RSOCKET
ServerType.NONE
The text was updated successfully, but these errors were encountered: