-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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
Unable to use reactive WebClient without spring-boot-starter-reactor-netty #9690
Comments
Yes, indeed, I'll turn this into a documentation improvement. Is there a particular piece of documentation that you find misleading? Or did you just apply the same reasoning that you'd use with |
I expected only the runtime plattform to change. I understand what's happening and I'd know how to fix it, but it's annoying and should be part of the docs. Something like: "if you want to use tc or undertow do this, but take care of including Reactor-Netty if you need web client" |
This is actually a bigger issue in that if we include the |
@dancingfrog You can set the web application type to none when creating your SpringApplication. |
@wilkinsona Thank you! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
True. But if I am creating a project intended to be used as a maven dependency in another project, the developer on the dependent project will have to do this as well. Excluding spring-boot-starter-tomcat worked with spring boot web. But it does not work with webflux. This is not ideal IMHO. Respectfully. |
I use the WebClient in a library which is used in console applications. A web server is not needed and only increases the overall size of the jar. According to me requiring a web server when you only need the client contradicts the idea of autoconfiguration. If there is no server in the classpath everything depending on it should not be configured. This is the idea of the "@ConditionalOn..." annotations, no? |
@gfinger since this issue got resolved, Spring Boot can now auto-configure |
@bclozel this might be a misunderstanding. It is possible to configure the http-client, yes. But you can not have the http-client without the server. I get the error message:
I know that I could use the whole webflux-starter dependency and disable the start of the server, for example in a console application. But this still gets me a lot of things in my jar, that are not needed. And, additionally, if I add the webflux-starter in a reuse-library, I have to advise all consumers of my library to take care about the required server. Not nice. As said above: I would expect that If there is no http-server in the classpath, the autoconfiguration considers this correctly and does not try to configure any component that might need the server. I open another issue about this topic. |
@gfinger We cannot have everything with a small footprints. Maybe you can use other webclient impl available like okhttp or httpcomponents. I think you will then have a smaller stuff embedded inside your java application's classpath. |
This is probably more of a documentation issue but when developing a reactive application on Tomcat (and probably others) and you exclude starter-reactor-netty like this
then
WebClient
won't work. The class is on the path but creating a new one withreturn WebClient.create("http://localhost:8080");
will fail:The text was updated successfully, but these errors were encountered: