Consider making the Service Bindings support part of Spring Boot #43882
Labels
for: team-meeting
An issue we'd like to discuss as a team to make progress
status: waiting-for-triage
An issue we've not yet triaged
The Spring Cloud Bindings library is very convenient for setting Spring Boot properties automatically from Kubernetes Secrets following the Kubernetes Service Binding API.
It's also conveniently added to the Paketo Buildpacks for Java out-of-the-box, when containerizing a Spring Boot application, though that might make it less straightforward to control in terms of versions and compatibility.
The Spring Cloud Bindings library is stricly related to Spring Boot, and sometimes it's not in sync with the latest Spring Boot versions whenever configuration properties are refactored. For example, that happened after Spring Boot 3 was released. I can imagine that it might take some extra maintenance to keep things in sync, while also trying to make it backward-compatible (especially considering the automatic inclusion in Buildpacks-generated container images). Furthermore, the release lifecycle is different, so it might delay upgrading to the latest Spring Boot version if the Spring Cloud Bindings project hasn't released support for it.
Since the only dependency the library has is on Spring Boot (no Spring Cloud dependency), and given the strict correlation with a given Spring Boot version, I would like to suggest considering including that small library into the Spring Boot project, while also simplifying its configuration.
Besides the benefits in terms of maintenance, testing and compatibility, having the Binding API available in Spring Boot would also simplify providing extensions from other Spring projects. For example, I contributed support for Service Bindings to the Spring AI project (see https://docs.spring.io/spring-ai/reference/api/cloud-bindings.html). It's based on Spring Cloud Bindings, but it's part of the Spring AI project itself. So, it's straightforward to maintain whenever there are property changes, and the compatibility is very clear since it's versioned and released together with the rest of the Spring AI artifacts. Still, this behavior might be a bit confusing since this strategy is not applied to other projects in the Spring portfolio. If the Binding API was available in Spring Boot itself, it would be possible to include the binding support as part of the main autoconfiguration, without requiring additional dependencies/configuration startegies.
Relates to #21322
The text was updated successfully, but these errors were encountered: