Skip to content

Extract WebClient from Spring WebFlux #31622

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

Closed
pcornelissen opened this issue Nov 19, 2023 · 4 comments
Closed

Extract WebClient from Spring WebFlux #31622

pcornelissen opened this issue Nov 19, 2023 · 4 comments
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue

Comments

@pcornelissen
Copy link

As far as I understood the RestTemplate is basically sundowning/frozen and the WebClient will be the http client to go in the future for WebMVC and WebFlux applications. So we can expect that sooner or later all/most webMVC applications will use webclient.
If in light of project loom RestClient will be "reinstated", then this will be less important, of course.

To use Webclient right now you have to include Webflux as dependency, so in a webmc application you will end up bringing in the full webmvc and webflux webstack as dependency, although you just want to use webclient.

My suggestion is that Webflux is split up, so you have a smaller dependency to be included in webMVC applications without bringing in the rest of webflux that you don't need and that may lead to problems.

There are at least a couple of advantages for doing that.

For example:

  • with Conditional definitions (like ConditionalOnClass) that are activated by accident, because something was just meant for WebFlux applications.
  • it's much more clear what you are including in your application
  • you include less dependencies which may cause security issues
  • ...
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 19, 2023
@sbrannen
Copy link
Member

Hi @pcornelissen,

Congratulations on creating your first issue for the Spring Framework! 👍

Unfortunately, this is a:

In the future, please search for existing issues before creating a new one.

Thanks


If in light of project loom RestClient will be "reinstated", then this will be less important, of course.

Regarding that, RestClient is new in Spring Framework 6.1 (which was just released) and is here to stay.

@sbrannen sbrannen closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2023
@sbrannen sbrannen added status: duplicate A duplicate of another issue in: web Issues in web modules (web, webmvc, webflux, websocket) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 19, 2023
@sbrannen sbrannen changed the title Extract Webclient from Webflux Extract WebClient from Spring WebFlux Nov 19, 2023
@pcornelissen
Copy link
Author

Ah sorry, did search, but didn't see this issue

@pcornelissen
Copy link
Author

(And it is closed and it's based on almost 6 year old assumptions/arguments, so maybe this issue might lead to new considerations)

@sbrannen
Copy link
Member

Hi @pcornelissen,

It's true that #21301 was closed more than 5 years ago; however, the arguments made then are still applicable today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants