Description
I'd like to suggest introducing a new Spring Boot starter aimed at client applications, with the necessary dependencies and autoconfiguration (e.g. RestClientAutoConfiguration
) for HTTP and for related slice tests. Perhaps, two starters for imperative and reactive scenarios: spring-boot-http-client-starter
and spring-boot-http-client-reactive-starter
, or something like that.
In the past few years, building CLI applications with Java has become more and more common, also thanks to projects like GraalVM and Spring Shell. Reducing the friction for bootstrapping a CLI project that needs HTTP interactions would greatly help increase the adoption of the Spring stack for this purpose.
Most recently, Spring AI brought new use cases for CLI applications, which would need an HTTP client infrastructure without the burden of an entire web server stack.
Besides the CLI use case, introducing such a starter would help imperative applications that need a WebClient (required by Spring AI for streaming scenarios, because RestClient doesn't support streaming) include just client dependencies instead of the entire server stack.
Whether it is possible to set the spring.main.web-application-type=none
property for disabling the web server part of the autoconfigured stack, the developer experience could be improved. Also, including several additional server dependencies which are not used is not ideal, especially from a maintenance and supply chain management point of view.
It would be great to be able to bootstrap a client-only application from Spring Initializr. I'm available to help with the implementation, if you think this is something that makes sense for the project.
Related issues on Spring Boot:
- Find a better way to detect when to start embedded servers #12973
- How can I get a WebClient without a required dependency to any web server? #34198
Related issues on Spring AI:
- Dependency on spring-boot-starter-web should be transitive or specified spring-ai#524
- Ensure that there is a RestClient.Builder in the application context spring-ai#563
- OpenAI Auto Configuration failing to apply Webclient configuration instead of RestClient. spring-ai#1066
Related issues on Spring Pet Clinic: