-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Consider how to support case sensitive key names with environment varaiables #18003
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
Since these are usually maps perhaps we need to find a way to push the key into the value. For example |
Hi, we bumped into the issue similar to #17975 when trying to set the data source properties when using HikariCP. Is there any update on the status of this ticket? Is it still pending design work or would it be ready for implementation?
One advantage I see with 1) would be the possibility to define env variables in different places without needing to worry about setting the index correctly. ANY_OPTION=socketTimeout:180
ANY_OTHER_OPTION=loginTimeout:60
SPRING_DATASOURCE_HIKARI_DATASOURCEPROPERTIES=$ANY_OPTION,$ANY_OTHER_OPTION The workaround provided with using |
Yes, I'm afraid so. The problem with configuring multiple key-value pairs is really a narrower variant of the problem with using
Thanks very much for the offer. Sharing your experience and ideas is already helpful. Beyond that, I'm not sure that there's much that can be done here at the moment. |
Hello, @wilkinsona ! In our internal framework built atop of Spring, we tried the approach of post-processing the config properties beans, where there are map-based properties and for such beans end users (or us) can provide a library-dependent dictionary (for example for Hikari) where all available properties could be fetched/mapped. Then the map got modified using the reflection and applied to a bean. The example project could be run with the environment variable like The approach is still pretty raw and some corner cases for the specific libraries should be considered ofc, for example there is a little difference of dictionary composition for Hibernate. Would that approach make sense? What do you think? |
@karmann-dm I think that's an interesting approach, but I suspect we'd have a lot of trouble keeping the dictionary files in sync. It would be nice if we could offer a hook point so you didn't need to use reflection. |
#17958 and #17975 shows how our current environment variable support suffers because it cannot deal with case sensitive values. The only current way to deal with these is by using the
SPRING_APPLICATION_JSON
variable.It would be nice if we could find a way to support case sensitive key names.
The text was updated successfully, but these errors were encountered: