Replies: 1 comment 2 replies
-
I agree that there's a little misalignment on how the settings are read, in fact the "lowercase and replace undescores with dots" logic that currently is in the Though...
this will be a breaking change, I know a lot of teams that are relying on that behavior. I would avoid such a change in the EDC core, also because I'm not aware about setting keys that contain the underscore. To achieve that you could write your own custom |
Beta Was this translation helpful? Give feedback.
-
The Problem
While going through the samples, I noticed in the
sample-03
that custom keys with uppercase letterscustom.Key
, custom keys in pascal casecustomKey
and custom keys in snake casecustom_key
, are not loaded. Inspecting the Connector code I was able to find the location where this behaviour is introduced. Theconnector.spi.common.core-spi.main.ConfigImpl
class converts all values to lower case and also replaces underscores with a dot. TheConfigImpl
class is called from theconnector.core.common.boot.main.DefaultServiceExtensionContext
.Suggested solutions
The easiest fix would be to make this the official behaviour and add documentation about this behaviour. The examples I suggest are:
Alternatively if we want to support more flexible options, such as environment variables with subkeys, e.g.
NAMESPACE__KEY_VALUE -> namespace.key_value
we would have to introduce a separateEnvironmentConfigImpl
to handle environment variables and aPropertiesConfigImpl
which can handle properties files. The benefit of this approach is that we would not deviate too much from the default Java properties file behaviour which indeed allows users to use any name for the keys. Using this would allow the following:I'm prepared to create a PR with a solution.
Beta Was this translation helpful? Give feedback.
All reactions